python-fire
python-fire copied to clipboard
fix using a Class for grouping commands --self shows as a flag
Hi!
Fix issue #382
After a lot of research I found out that the only way (I'm 99% sure about this) of knowing if a function belongs to a class is using __qualname__. The only issue I see with this solution is that __qualname__ belongs to python 3.3 and newer versions.
Another solution that I can think of is to check and to remove the 'self' argument from every function, regardless of whether it belongs to a class or not. This solution will limit the user to not name the argument from a function, that doesn't belong to a class, 'self'.
Let me know what you think and I'll be happy to make the changes, as well as to make any correction :)
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.