Message32544
I agree that it's confusing.
The reason is that unicode() with only one argument will use PyObject_Unicode() for the conversion (which then applies some extra logic to turn a non-string argument to a string), while the variant with an encoding will interface to PyUnicode_FromEncodedObject() which only works for strings and character buffers.
I think that all three APIs, PyUnicode_FromObject(), PyUnicode_FromEncodedObject() and PyObject_Unicode() should be unified to use the same logic in their way of converting an object to Unicode. In the light of Py3k, it's probably best to then go with the PyObject_Unicode() approach.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:58:49 | admin | link | issue1758804 messages |
2007-08-23 14:58:49 | admin | create | |
|