On Tue, Apr 5, 2022 at 7:49 AM Greg Ewing <[email protected]>
wrote:
>
> It's only there now for backwards compatibility. It's not
>
Not always. I have an example, where a method creates a closure that calls
super, requiring the class/self pair as there isn't enough context for
parameterless super. (And also in __new__??? I seem to recall running
into that.)
class B:
def method(self):
...
class C(B):
def method(self):
def closure():
# super(C, self).method() # This will fix it...
super().method() # Unbound, but no context for class or self.
return closure
>>> C().method()()
RuntimeError: super(): no arguments
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/R3YMAAYI2F37BKKEXJPHGF7ZGHC5CMCG/
Code of Conduct: http://python.org/psf/codeofconduct/