{"action":"closed","issue":{"url":"https://api.github.com/repos/google/python-fire/issues/47","repository_url":"https://api.github.com/repos/google/python-fire","labels_url":"https://api.github.com/repos/google/python-fire/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/google/python-fire/issues/47/comments","events_url":"https://api.github.com/repos/google/python-fire/issues/47/events","html_url":"https://github.com/google/python-fire/issues/47","id":218244849,"number":47,"title":"Limit member exposition from an instance","user":{"login":"cletomartin","id":835780,"avatar_url":"https://avatars2.githubusercontent.com/u/835780?v=3","gravatar_id":"","url":"https://api.github.com/users/cletomartin","html_url":"https://github.com/cletomartin","followers_url":"https://api.github.com/users/cletomartin/followers","following_url":"https://api.github.com/users/cletomartin/following{/other_user}","gists_url":"https://api.github.com/users/cletomartin/gists{/gist_id}","starred_url":"https://api.github.com/users/cletomartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cletomartin/subscriptions","organizations_url":"https://api.github.com/users/cletomartin/orgs","repos_url":"https://api.github.com/users/cletomartin/repos","events_url":"https://api.github.com/users/cletomartin/events{/privacy}","received_events_url":"https://api.github.com/users/cletomartin/received_events","type":"User","site_admin":false},"labels":[{"id":544836578,"url":"https://api.github.com/repos/google/python-fire/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-30T15:55:57Z","updated_at":"2017-03-31T17:39:33Z","closed_at":"2017-03-31T17:39:33Z","body":"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."}}
{"actor":{"display_login":"dbieber"}}