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.

Author hthompson
Recipients
Date 2002-11-12.16:45:37
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=612691

Usually it does not have __str__, so __repr__ is getting used.
In other cases, the class does have a __str__, and it gets
used, but even then I think it shouldn't if there's a
__unicode__

All this presumes there's a way to diagnose whether files
are wide or narrow -- I'm not familiar enough with the
implementation details here to know if this makes sense or not.

My original message made the point as follows:

If you call str(object), and object's class has a __str__
method, the
  value is the value of the __str__ method;

If you print an object to a normal stream, and object's
class has a
  __str__ method, what appears is the result of the __str__
method.

If you call unicode(object), and object's class has a
__unicode__ method, the
  value is the value of the __unicode__ method;

So far so good, but read on . . .

If you print an object to a unicode stream, and object's
class has a
  __unicode__ method, what appears is the result of . . .

_not_ the __unicode__ method, but the __str__ method, if
there is one,
otherwise the usual default
History
Date User Action Args
2007-08-23 16:05:57adminlinkissue637094 messages
2007-08-23 16:05:57admincreate