weak - Weakref workarounds

For some reason, methods don’t play well with weakref, and need some kind of workaround that keep the weakref on the method’s instance instead of the method itself.

weak.methodref(method)

Returns a weakref to method. This weakref, unlike a normal weakref, will behave correctly with that method.

Previous topic

testutil - Unit testing utilities

This Page