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 benjamin.peterson, ereuveni, fdrake, gdr@garethrees.org, gvanrossum, pitrou
Date 2015-04-28.11:54:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430222078.22.0.870335644966.issue24067@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, PEP 205 explains it a bit more:

"the resulting proxy cannot be used as a dictionary key since it cannot be compared once the referent has expired, and comparability is necessary for dictionary keys. Operations on proxy objects after the referent dies cause weakref.ReferenceError to be raised in most cases."

Perhaps this can be relaxed, and comparison simply made to return false. The following behaviour is a bit troubling :-)

>>> p
<weakproxy at 0x7f4054fe8cd8 to NoneType at 0x88a780>
>>> p == p
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ReferenceError: weakly-referenced object no longer exists
History
Date User Action Args
2015-04-28 11:54:38pitrousetrecipients: + pitrou, gvanrossum, fdrake, benjamin.peterson, gdr@garethrees.org, ereuveni
2015-04-28 11:54:38pitrousetmessageid: <1430222078.22.0.870335644966.issue24067@psf.upfronthosting.co.za>
2015-04-28 11:54:38pitroulinkissue24067 messages
2015-04-28 11:54:37pitroucreate