Simpler way to call super methods without all the repetition
License: ISC - See LICENSE.txt file
This is a simple piece of code born out of our frustration with the repetitiveness of calling overridden methods in python. having to write
super(TheCurrentClassThatImIn, self).the_method_that_im_currently_in(all, the, arguments, again)
every time you want to do that is just not DRY and makes refactoring that much more tedious.
Wouldn’t it be much cooler if you could just write self.super() instead? Yeah, we thought so, too.
In the class where you want to use this (or any superclass), you need to make the SuperProxy available like this:
class SuperClass(object): super = SuperProxy()
Afterwards you can just use it in three forms in any method: - Auto-pick-up all available arguments and call the super method of the current method
Call super method of current method but with explicit arguments
Get a proxy for the superclass and call a specific method with specific arguments
(self.super is the same as super(CurrentClass, self) but more DRY)
1.0.5 and 1.0.6, 1.0.7, 1.0.8, 1.0.9 (2016-09-07)