Open giselher opened 12 years ago
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: f7fa7a17d3fabe1847c20054a13749f37b0fb870
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)