Title: Limit member exposition from an instance · Issue #47 · google/python-fire · GitHub
Open Graph Title: Limit member exposition from an instance · Issue #47 · google/python-fire
X Title: Limit member exposition from an instance · Issue #47 · google/python-fire
Description: Hi, firstly I would like to thank you guys for this great library. I would like to know if there is a way for limiting the members I can return to Fire in my functions. Let me give you an example about how I (half) resolved this: import ...
Open Graph Description: Hi, firstly I would like to thank you guys for this great library. I would like to know if there is a way for limiting the members I can return to Fire in my functions. Let me give you an example a...
X Description: Hi, firstly I would like to thank you guys for this great library. I would like to know if there is a way for limiting the members I can return to Fire in my functions. Let me give you an example a...
Opengraph URL: https://github.com/google/python-fire/issues/47
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Limit member exposition from an instance","articleBody":"Hi,\r\n\r\nfirstly I would like to thank you guys for this great library.\r\n\r\nI would like to know if there is a way for limiting the members I can return to Fire in my functions. Let me give you an example about how I (half) resolved this:\r\n\r\n```\r\nimport fire\r\n\r\nclass Obj:\r\n def __init__(self):\r\n self.safe = 'safe!'\r\n\r\n def dangerous(self):\r\n print('dangerous!')\r\n\r\nclass App:\r\n def show(self):\r\n obj = Obj()\r\n return {'safe': obj.safe}\r\n\r\nif __name__ == '__main__':\r\n fire.Fire(App, name='app')\r\n```\r\n\r\nThis makes the job as I expect, although the `--help` functionality is not as friendly as I would need since, without any parameter, `show` returns the dictionary (as one could expect):\r\n\r\n```\r\n$ python app.py show \r\nsafe: safe!\r\n```\r\nBut, instead, I would need to have a behaviour similar to the following:\r\n\r\n```\r\n$ python app.py show --help\r\nUsage: app show \r\n app show safe\r\n```\r\n\r\nIs it possible to enforce to show the help output if no parameter is provided to `show` instead of evaluating all it? Maybe using a dictionary for restricting the access to some members is not the right way to do it. I have also tried to return a `fire.Fire` instance but then I lose the execution chain in the usage (i.e. `app show ...`).\r\n\r\nThanks in advance.","author":{"url":"https://github.com/cletomartin","@type":"Person","name":"cletomartin"},"datePublished":"2017-03-30T15:55:57Z","url":"https://github.com/google/python-fire/issues/47"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e7787792-ac35-8f40-84e4-36abb29b6a63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98E4:160A87:8FFB6C:BB2EE3:6AFFE3DE |
| html-safe-nonce | 8135089ef7f3ae8451c95f86834c2b6e11390d812ee58c09b177761e5ff4f68b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEU0OjE2MEE4Nzo4RkZCNkM6QkIyRUUzOjZBRkZFM0RFIiwidmlzaXRvcl9pZCI6IjY0MTQ0MTY2NDE5ODcxNzUzOTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 47dabd50739f4ed6fbb16367695bececb69f69d8d578480d75602328edc73eeb |
| hovercard-subject-tag | issue:218244849 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/google/python-fire/47/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b01f2fa4e862508ca46117e387bd66fad4833c990e1e009a7101178572da4734/google/python-fire/issues/47 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b01f2fa4e862508ca46117e387bd66fad4833c990e1e009a7101178572da4734/google/python-fire/issues/47 |
| og:image:alt | Hi, firstly I would like to thank you guys for this great library. I would like to know if there is a way for limiting the members I can return to Fire in my functions. Let me give you an example a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cletomartin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/google/python-fire git https://github.com/google/python-fire.git |
| octolytics-dimension-user_id | 1342004 |
| octolytics-dimension-user_login | |
| octolytics-dimension-repository_id | 82729529 |
| octolytics-dimension-repository_nwo | google/python-fire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82729529 |
| octolytics-dimension-repository_network_root_nwo | google/python-fire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width