[Python-ideas] A decorator to call super()
Roberto MartÃnez
robertomartinezp at gmail.com
Tue Jan 31 02:13:15 EST 2017
More information about the Python-ideas mailing list
Tue Jan 31 02:13:15 EST 2017
- Previous message (by thread): [Python-ideas] [docs] https://docs.python.org/fr/ ?
- Next message (by thread): [Python-ideas] A decorator to call super()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I find this type of code quite often:
class MyOverridedClass(MyBaseClass):
def mymethod(self, foo, **kwargs):
# Do something
return super().mymethod(**kwargs)
What about creating a decorator to call super() after/before the overrided
method? Something like that:
class MyOverridedClass(MyBaseClass):
@extendsuper
def mymethod(self, foo):
# Do something
Sorry if this has already been proposed, I have not found anything similar
in the list.
Best regards,
Roberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170131/905c89ed/attachment.html>
- Previous message (by thread): [Python-ideas] [docs] https://docs.python.org/fr/ ?
- Next message (by thread): [Python-ideas] A decorator to call super()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list