Author nascheme
Recipients
Date 2005-03-09.01:43:16
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
"'%s' % unicode_string" produces a unicode result.  I
think the following code should also return a unicode
string:

class Wrapper:
....def __str__(self):
........return unicode_string
'%s' % Wrapper()

That behavior would make it easier to write library
code that can work with either str objects or unicode
objects.

The fix is pretty simple (see that attached patch). 
Perhaps the PyObject_Text function should be called
_PyObject_Text instead.  Alternatively, if the function
is make public then we should document it and perhaps
also provide a builtin function called 'text' that uses it.


History
Date User Action Args
2007-08-23 15:42:06adminlinkissue1159501 messages
2007-08-23 15:42:06admincreate