3 ms·
I think I might be missing your point. Instead of calling super().foo() why not use explicit super(self.__class__, self).foo()? Afaik super uses some runtime bi
by bsdz 4y ago
I think I might be missing your point. Instead of calling super().foo() why not use explicit super(self.__class__, self).foo()? Afaik super uses some runtime binding to set the parameters so if one's skipping that execution due to monkey patching then one has to use explicit form.
- tonyg 4y agoBecause `@extend` should work for the middle of an inheritance hierarchy too, not just the tips: class Base: def foo(self): print('base') class Mid(Base): def foo(self): print('mid') super(self.__class__, self).foo() class Derived(Mid): def foo(self): print('derived') super(self.__class__, self).foo() Derived().foo()