René's URL Explorer Experiment


Title: Using `--help` with `file.Fire()` usage incorrectly prints imports and variables · Issue #220 · google/python-fire · GitHub

Open Graph Title: Using `--help` with `file.Fire()` usage incorrectly prints imports and variables · Issue #220 · google/python-fire

X Title: Using `--help` with `file.Fire()` usage incorrectly prints imports and variables · Issue #220 · google/python-fire

Description: When running --help against a program like the following, I expect a single my_func command but instead I get my_func, fire, logging, GREETING_MSG, and logger. I would like to be able to ignore python module imports and local variables b...

Open Graph Description: When running --help against a program like the following, I expect a single my_func command but instead I get my_func, fire, logging, GREETING_MSG, and logger. I would like to be able to ignore pyt...

X Description: When running --help against a program like the following, I expect a single my_func command but instead I get my_func, fire, logging, GREETING_MSG, and logger. I would like to be able to ignore pyt...

Opengraph URL: https://github.com/google/python-fire/issues/220

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using `--help` with `file.Fire()` usage incorrectly prints imports and variables","articleBody":"When running `--help` against a program like the following, I expect a single `my_func` command but instead I get `my_func`, `fire`, `logging`, `GREETING_MSG`, and `logger`. I would like to be able to ignore python module imports and local variables by default.\r\n\r\n```python\r\nimport fire\r\nimport logging\r\n\r\nGREETING_MSG = \"Hello\"\r\n\r\nlogger = logging.get_logger()\r\n\r\ndef _my_internal_hidden_func():\r\n    # This is correctly ignored\r\n    pass\r\n\r\ndef my_func():\r\n    logger.info(f\"{GREETING_MSG}, world\")\r\n\r\nif __name__ = \"__main__\":\r\n    fire.Fire()\r\n```\r\n\r\nFor the simple example above, the obvious resolution is to use a different method of invoking `Fire()` but for my actual use case, there are over 40 functions in the file I want to expose. For internal functions, I can hide these simply be preceeding the name with underscore, but I don't see any similar way of suppressing the imports and variable definitions.\r\n\r\nI'd propose resolving this in one of two ways:\r\n (1) Add some kind of heuristic to the default fire.Fire() invocation to ignore imports and variables\r\n (2) Add some type of flags and/or lambda function support so the code consuming Fire can customize this logic without having to create and directly pass a custom dictionary of all functions.\r\n\r\nIs anything like this already in progress, and/or would something along these lines be accepted as a pull request?\r\n\r\nThanks!","author":{"url":"https://github.com/aaronsteers","@type":"Person","name":"aaronsteers"},"datePublished":"2020-02-18T05:44:23Z","url":"https://github.com/google/python-fire/issues/220"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:aedf0593-c052-a3c9-5e6a-711594870e0e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE63E:23D776:86ACC2:AFB2AA:6AFFE3E7
html-safe-noncee04e0a67b56a82237e647407840ffd3a9c8d88f1ac84e5207c0652a6e8a4f8ff
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjNFOjIzRDc3Njo4NkFDQzI6QUZCMkFBOjZBRkZFM0U3IiwidmlzaXRvcl9pZCI6IjcxODI4NjgzNjM3NzE2MzQ2NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac841075106b3bcdad77cd3c9b2ddbeb6771ea1bc888b835504a3dd3e35e2f6e8d
hovercard-subject-tagissue:566661640
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/python-fire/220/issue_layout
twitter:imagehttps://opengraph.githubassets.com/804c8ad33e37b965ddad31a8a378ac3b9745ef637c276c88fd1e590f9e591a03/google/python-fire/issues/220
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/804c8ad33e37b965ddad31a8a378ac3b9745ef637c276c88fd1e590f9e591a03/google/python-fire/issues/220
og:image:altWhen running --help against a program like the following, I expect a single my_func command but instead I get my_func, fire, logging, GREETING_MSG, and logger. I would like to be able to ignore pyt...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaaronsteers
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
turbo-cache-controlno-preview
go-importgithub.com/google/python-fire git https://github.com/google/python-fire.git
octolytics-dimension-user_id1342004
octolytics-dimension-user_logingoogle
octolytics-dimension-repository_id82729529
octolytics-dimension-repository_nwogoogle/python-fire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id82729529
octolytics-dimension-repository_network_root_nwogoogle/python-fire
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/google/python-fire/issues/220#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fpython-fire%2Fissues%2F220
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogle%2Fpython-fire%2Fissues%2F220
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=google%2Fpython-fire
Reloadhttps://github.com/google/python-fire/issues/220
Reloadhttps://github.com/google/python-fire/issues/220
Reloadhttps://github.com/google/python-fire/issues/220
googlehttps://github.com/google
python-firehttps://github.com/google/python-fire
Codehttps://github.com/google/python-fire
Issues146 (146)https://github.com/google/python-fire/issues
Pull requests85 (85)https://github.com/google/python-fire/pulls
Actionshttps://github.com/google/python-fire/actions
Projectshttps://github.com/google/python-fire/projects
Security and qualityhttps://github.com/google/python-fire/security
Insightshttps://github.com/google/python-fire/insights
https://github.com/google/python-fire
New issuehttps://github.com/login?return_to=https://github.com/google/python-fire/issues/220
New issuehttps://github.com/login?return_to=https://github.com/google/python-fire/issues/220
Using --help with file.Fire() usage incorrectly prints imports and variableshttps://github.com/google/python-fire/issues/220#top
enhancementhttps://github.com/google/python-fire/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/aaronsteers
aaronsteershttps://github.com/aaronsteers
on Feb 18, 2020https://github.com/google/python-fire/issues/220#issue-566661640
dbieberhttps://github.com/dbieber
enhancementhttps://github.com/google/python-fire/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Feb 28, 2020https://github.com/google/python-fire/issues/220#event-3082841973
https://github.com/masq
masqhttps://github.com/masq
on Jun 25, 2020https://github.com/google/python-fire/issues/220#issuecomment-649871901
#204https://github.com/google/python-fire/issues/204
https://github.com/gaardhus
gaardhushttps://github.com/gaardhus
on Oct 23, 2023https://github.com/google/python-fire/issues/220#issuecomment-1775887922
Sign up for freehttps://github.com/signup?return_to=https://github.com/google/python-fire/issues/220
Sign in to commenthttps://github.com/login?return_to=https://github.com/google/python-fire/issues/220
enhancementhttps://github.com/google/python-fire/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.