<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Roberto,<br>
<br>
On 31.01.2017 08:13, Roberto Martínez wrote:<br>
</div>
<blockquote
cite="mid:CAF0TK51PpOUsLwEQ5yfuAdhJ6Fy0kid5=u5BwpHSk+_NmUX18w@mail.gmail.com"
type="cite">
<div dir="ltr">class MyOverridedClass(MyBaseClass):
<div> def mymethod(self, foo, **kwargs):</div>
<div> # Do something</div>
<div> return super().mymethod(**kwargs)</div>
<div><br>
</div>
<div>What about creating a decorator to call super()
after/before the overrided method? Something like that:</div>
<div><br>
</div>
<div>class MyOverridedClass(MyBaseClass):</div>
<div> @extendsuper</div>
<div> def mymethod(self, foo):</div>
<div> # Do something</div>
</div>
</blockquote>
<br>
I could find this useful. There's just on bikeshedding issue:<br>
<br>
When should "super().mymethod(**kwargs)" be called: <b>before</b>,
<b>after</b> or inbetween my specialized code?<br>
<br>
Depending on the baseclass either of those three is necessary. As
far as I can tell, we encounter all of them regularly.<br>
<br>
Best,<br>
Sven<br>
</body>
</html>