[Python-checkins] python/dist/src/Include unicodeobject.h,2.38,2.39

lemburg@users.sourceforge.net lemburg@users.sourceforge.net
Sun, 11 Aug 2002 05:23:05 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv573/Include

Modified Files:
	unicodeobject.h 
Log Message:
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.



Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.38
retrieving revision 2.39
diff -C2 -d -r2.38 -r2.39
*** unicodeobject.h	29 May 2002 11:33:13 -0000	2.38
--- unicodeobject.h	11 Aug 2002 12:23:03 -0000	2.39
***************
*** 518,521 ****
--- 518,533 ----
  #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 =====================================================