March 2003
Intermediate to advanced
656 pages
39h 30m
English
__unicode__ — Python 2.2 and later
__unicode__(self)
The
unicode(
x
)
built-in type call, in Python 2.2 and later, invokes
x
.__unicode__( ), if
present, in preference to x
.__str__( ). If a class supplies both special methods
__unicode__ and __str__,
the two should return equivalent strings (of Unicode and plain string
type respectively).