-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
Don't use __slots__ #223
Comments
They are especially bad when multi-inheritance kicks in, as they will become ineffective if one base doesn't have slots, or downright prevent multi-inheritance. As #222 can easily be circumvented, I see no need to remove slots everywhere though. |
I'd argue that this is an easy circumvention. The proper fix is to implement a real debugging interface in GitPython that doesn't rely on hacking through environment variables (which are hard to set in some contexts, such as when running a script from an editor). |
As it seems to be a 'hack' to set a class member, as well as to use environment variables in general, there seems to be no way you can use the existing debugging interface. |
The idea way is to define an application level debug switch that can be turned on and off as desired. |
Thank you, but what is the API you have in mind or that you are used to ? Could you make an example ? import git
last_val = git.set_debugging(None|True|'full')
...
git.set_debugging(last_val) |
Will be enough for me. |
The only useful application of
__slots__
in Python is for heavy performance optimization. GitPython performance bottleneck is in external calls, so__slots__
won't help it. If you want to protect visibility of internal methods, use__
prefix. Slots are an impediment - #222See also https://stackoverflow.com/questions/472000/python-slots and http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/
The text was updated successfully, but these errors were encountered: