super() in injected methods

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 11 16:43:43 EST 2021


On 12/02/21 7:05 am, Andras Tantos wrote:

>      a = B()
>      a.m(41)
>      a.m = MethodType(method, a)
>      a.m(42)

Are you sure you really need to inject methods into instances
like this? What problem are you trying to solve by doing so?
There's almost certainly a better way to approach it.

-- 
Greg


More information about the Python-list mailing list