-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fire.Fire() ruins fire.Fire(fire.Fire) #3
Comments
You can certainly inspect the Fire function with Fire! To inspect a function without calling it, and '-- --help' to your command. Without that, the function will get called. And as you noticed, when Fire is called with no arguments, it spits out all your locals and globals. |
Why does a callable class not get called?
Unrelated rant: I personally feel the zero-arity |
Not a problem.
Yes, largely I agree. Currently I'm leaning toward having --help behave the same as '-- --help' (e.g. preventing the final fn/class from being called/instantiated) except in the case where the fn accepts a help argument (either explicitly or via **kwargs). I want to as much as possible allow Fire to work on any Python component at all.
This is because we currently only look for argspecs on classes and routines, but not on other objects (in your example it's the instantiated object that is callable, not the class itself).
Good catch. We should fix this. |
The getsourcefile issue is resolved now. 1239bdd |
hi how are you
|
Hi python-fire,
fire.Fire
looked like a very interesting function so I wanted to inspect it withfire.Fire
. I was surprised that the interpreter printed out a dictionary with all my locals and globals.I'm not sure if that's what you guys intended to happen, I guess it kind of is because of
fire.Fire()
defined as a valid invocation which meansfire.Fire(globals() + locals())
. Perhaps it's worth considering introducing a different function that would do that?fire.FireThisModule()
?The text was updated successfully, but these errors were encountered: