> I don't have anything older than 2.4 laying around either, but IIRC
> in 2.3 unicode() did not call __unicode__().

It turns out __unicode__() is called on Python 2.3.5.

% python2.3
Python 2.3.5 (#2, Oct 18 2006, 23:04:45)
[GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
...   def __unicode__(self):
...     print "unicode"
...     return u"hi"
...   def __str__(self):
...     print "str"
...     return "hello"
...
>>> unicode(Foo())
unicode
u'hi'

-- 
Michael Urman  http://www.tortall.net/mu/blog
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to