[issue23841] py34 OrderedDict is using weakref for root reference

Antoine Pitrou report at bugs.python.org
Sun Apr 5 13:42:09 CEST 2015


Antoine Pitrou added the comment:

Concretely, the possible workarounds are:

- don't do anything complex in your __del__
- be prepared to deal with unexpected errors in your __del__
- starting from Python 3.4, don't define __del__ and use weakref.finalize() instead: https://docs.python.org/3/library/weakref.html#weakref.finalize

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23841>
_______________________________________


More information about the Python-bugs-list mailing list