Mercurial > cpython-lru_cache-weakref
diff Include/unicodeobject.h @ 25638:29d40eae8736 2.2
Backport:
2002/08/11 12:23:04 lemburg Python/bltinmodule.c 2.262
2002/08/11 12:23:04 lemburg Objects/unicodeobject.c 2.162
2002/08/11 12:23:03 lemburg Misc/NEWS 1.461
2002/08/11 12:23:03 lemburg Lib/test/test_unicode.py 1.65
2002/08/11 12:23:03 lemburg Include/unicodeobject.h 2.39
Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.
u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.
Closes SF bug #593581.
| author | Michael W. Hudson <mwh@python.net> |
|---|---|
| date | Mon, 07 Oct 2002 12:32:57 +0000 |
| parents | dd350b639309 |
| children |
line wrap: on
line diff
--- a/Include/unicodeobject.h Mon Oct 07 12:21:09 2002 +0000 +++ b/Include/unicodeobject.h Mon Oct 07 12:32:57 2002 +0000 @@ -517,6 +517,18 @@ #endif +/* --- Unicode ordinals --------------------------------------------------- */ + +/* Create a Unicode Object from the given Unicode code point ordinal. + + The ordinal must be in range(0x10000) on narrow Python builds + (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is + raised in case it is not. + +*/ + +extern DL_IMPORT(PyObject*) PyUnicode_FromOrdinal(int ordinal); + /* === Builtin Codecs ===================================================== Many of these APIs take two arguments encoding and errors. These
