Message47901
"'%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.
|
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:42:06 | admin | link | issue1159501 messages |
| 2007-08-23 15:42:06 | admin | create | |
|