diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 17:09:53 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 17:09:53 (GMT) |
commit | ad7c98e264bbc9c84e911417c8770f6e95ffb794 (patch) | |
tree | 7586edae78b019c6c2db46861da762083e0c3c8a /Misc | |
parent | d5c43065d5aa7bd8b9ec67525bd01d2c09a7759f (diff) | |
download | cpython-ad7c98e264bbc9c84e911417c8770f6e95ffb794.zip cpython-ad7c98e264bbc9c84e911417c8770f6e95ffb794.tar.gz cpython-ad7c98e264bbc9c84e911417c8770f6e95ffb794.tar.bz2 |
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -3,6 +3,14 @@ What's New in Python 2.1 alpha 1? 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 |