[docs] [issue9658] weakref.proxy unequal to its referent in 2.x

Terry J. Reedy report at bugs.python.org
Sat Aug 21 23:31:02 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

This is definitely not a critical fix for 2.6 ;-)

The weakref.proxy doc says nothing about comparisons:

"weakref.proxy(object[, callback]) 
Return a proxy to object which uses a weak reference. This supports use of the proxy in most contexts instead of requiring the explicit dereferencing used with weak reference objects. The returned object will have a type of either ProxyType or CallableProxyType, depending on whether object is callable. Proxy objects are not hashable regardless of the referent; this avoids a number of problems related to their fundamentally mutable nature, and prevent their use as dictionary keys. callback is the same as the parameter of the same name to the ref() function."

so this is not a behavior bug.

A patch for 2.7 could include a note that the behavior changes in 3.x. The 3.x patch should only say what the 3.x behavior is. This is assuming that the behavior should be defined as in 3.x for all implementations. Since it seems straightforward, it seems reasonable to me to do so.

The comparison behavior of 'basic' types is actually defined in the ref manual section 5.9 Comparisons (3.1). Cross-type behavior is summarized as "Comparison of objects of the differing types depends on whether either of the types provide explicit support for the comparison." I think the detailed info for weakref proxys belongs with the weakref proxy entry as suggested above.

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python, terry.reedy
stage:  -> needs patch
versions: +Python 3.1, Python 3.2 -Python 2.6

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


More information about the docs mailing list