Antoine Pitrou added the comment:

> So consider what happens if you forward the __hash__ method to the
> proxied object: the hash will change when the object dies.

ref objects behave differently: they inherit their referent's hash value when 
alive, and remember it.  proxy objects could be made to behave the same way.

> The hash support for ref objects is definitely a very special case, 
> only intended to support WeakKeyDictionary

I've relied several times on the hashability of ref objects, in third-party 
code.
(OTOH, I never use weakref proxies)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24067>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to