This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients docs@python, fdrake, ncoghlan, pitrou, sbt, tim.peters
Date 2012-05-28.13:17:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338211059.84.0.366871304361.issue14933@psf.upfronthosting.co.za>
In-reply-to
Content
In http://docs.python.org/dev/extending/newtypes.html?highlight=pyobject_clearweakrefs#weak-reference-support, you can read:

“The only further addition is that the destructor needs to call the weak reference manager to clear any weak references. This should be done before any other parts of the destruction have occurred”

I don't believe there is any need to clear weakrefs before starting with other parts of the destruction. Weakref callbacks cannot access the original object, by construction (else they never get called).

Actually, if a weakref callback can rely on some resources having been released (say, a file descriptor), it is better to clear the weakrefs *after* other parts of the destruction.

This seems to be a by-product of the erroneous doc committed in SVN r16381, part of which was removed in r18223.
History
Date User Action Args
2012-05-28 13:17:39pitrousetrecipients: + pitrou, tim.peters, fdrake, ncoghlan, docs@python, sbt
2012-05-28 13:17:39pitrousetmessageid: <1338211059.84.0.366871304361.issue14933@psf.upfronthosting.co.za>
2012-05-28 13:17:39pitroulinkissue14933 messages
2012-05-28 13:17:38pitroucreate