[Python-ideas] Make __class__ (and maybe other magic variables) visible to functions that was defined outside a class, but then rebound into a class?

2021-07-27 Thread Yua
For example, the following code would report an error: class base():     def foo(self) -> None:     print('Base!') def placement(self) -> None:     super().foo() class child(base):     def foo(self) -> None:     pass     foo = placement child().foo()

[Python-ideas] Re: Make __class__ (and maybe other magic variables) visible to functions that was defined outside a class, but then rebound into a class?

2021-07-27 Thread Yua
    def foo(self) -> None:     print('Child!')     foo = placement class another(base):     foo = child.foo another().foo() Results in the familiar RuntimeError: super(): __class__ cell not found. Thank you! Yua On 28/07/2021 11:29, Christopher Barker wrote: Ho