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 lemburg
Recipients
Date 2007-07-23.14:32:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:58:49adminlinkissue1758804 messages
2007-08-23 14:58:49admincreate