Weakref compatibility.

weakref_backports is a partial backport of the weakref module for Python versions below 3.4.

Copyright (C) 2013 Python Software Foundation, see LICENSE.python for details.

The following changes were made to the original sources during backporting:

  • Added self to super calls.
  • Removed from None when raising exceptions.

Module Contents


WeakMethod() Weak reference to bound method.
class WeakMethod

Weak reference to bound method.

A custom weakref.ref subclass which simulates a weak reference to a bound method, working around the lifetime problem of bound methods.

__new__(meth, callback=None)