-
Notifications
You must be signed in to change notification settings - Fork 9
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
Usage of super in ptyhandler.py #5
Comments
For Python 3 compatiblity, the whole codebase should be converted to use new-style classes. This should not be too hard to do, I hope. |
I still prefer to use usual inherit method instead of super, because it not only looks nicer but you don't have to worry about the downsides of super. For reference: |
New-style classes have been introduced in Python 2.2, released in 2001 (!), and old-style classes will be removed with 3.0. Searching the web, I could not find any real downsides of new-style classes, other than some people using them incorrectly and some more or less constructed examples involving multiple inheritance. Is there anything I am missing? The use of new-style classes seems to be encouraged over old-style classes, see for example: |
It is fixed in this commit: f7fa7a1 |
As a short-term solution, plugins/Navigation/NavigationPlugin.py still needs to be fixed as it includes the same construct as ptyhandler.py did. For the longer-term solution, I still think that new-style classes are the way to go. super()'s caveats seem to be very much tied to multiple inheritance, which should not be a problem in our case. |
As said in the meeting the code is written with old style classe in mind and super should be only be used in new style classes.
Link to the code line: https://github.com/rainerf/ricodebug/blob/master/src/helpers/ptyhandler.py#L33
Use cases for super from the python 2.7 Documentation (http://docs.python.org/library/functions.html?highlight=super#super)
The text was updated successfully, but these errors were encountered: