This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects.
A new C API PyObject_Unicode() is also provided.
This closes patch #101664.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
diff --git a/Misc/NEWS b/Misc/NEWS
index 15f4513..27355ed 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3,6 +3,14 @@
Core language, builtins, and interpreter
+- There is a new Unicode companion to the builtin str() function
+ called unistr(). Like str(), it calls either the tp_str slot of
+ objects or the "__str__" method and converts the returned value
+ to an Unicode object (in case this is necessary).
+
+ The unistr() is complemented by a new PyObject_Unicode() C API
+ which behaves in the same way.
+
- The comparison operators support "rich comparison overloading" (PEP
207). C extension types can provide a rich comparison function in
the new tp_richcompare slot in the type object. The cmp() function