Message80416
Calling the unicode function on a proxy object, doesn't use the proxi-ed
object's __unicode__ method, but its __str__ method.
>>> class A(object):
... def __str__(self):
... return "str"
... def __unicode__(self):
... return "unicode"
...
>>> a = A()
>>> unicode(a)
u'unicode'
>>> import weakref
>>> b = weakref.proxy(a)
>>> unicode(b)
u'str'
I expected the last result to be u'unicode'. I did get u'unicode' in
Python 2.5 (but not in 2.6). |
|
| Date |
User |
Action |
Args |
| 2009-01-23 15:03:31 | Taldor | set | recipients:
+ Taldor |
| 2009-01-23 15:03:31 | Taldor | set | messageid: <1232723011.79.0.257405867279.issue5037@psf.upfronthosting.co.za> |
| 2009-01-23 15:02:41 | Taldor | link | issue5037 messages |
| 2009-01-23 15:02:40 | Taldor | create | |
|