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.

classification
Title: weakref: proxy_print and proxy_repr incons.
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, gvanrossum
Priority: high Keywords:

Created on 2003-04-16 21:49 by gvanrossum, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (2)
msg15480 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-16 21:49
For weakref.proxy, the behavior of proxy_print() in
"cooked" mode is inconsistent with the behavior of
proxy_repr(). "cooked" mode printing is used when a
value is displayed at the command line. Sample session:

>>> class C: pass
... 
>>> from weakref import proxy
>>> a = C()
>>> p = proxy(a)
>>> p
<__main__.C instance at 0x400e864c>
>>> print repr(p)
<weakproxy at 0x400e343c to instance at 0x400e864c>
>>>

The output should be the same in both cases.

(My suggestion: get rid of proxy_print. Might be a tad
slower in extreme cases, but gets this right with ease. :-)
msg15481 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2003-07-14 21:46
Logged In: YES 
user_id=3066

Fixed in the manner suggested in Objects/weakrefobject.c
revision 1.13.
Backport candidate.
History
Date User Action Args
2022-04-10 16:08:11adminsetgithub: 38315
2003-04-16 21:49:19gvanrossumcreate