[pypy-commit] pypy default: cpyext: add PyUnicode_GetMax()

amauryfa noreply at buildbot.pypy.org
Thu Feb 23 21:19:50 CET 2012

Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Changeset: r52817:16b015b252c3
Date: 2012-02-23 00:25 +0100

Log:	cpyext: add PyUnicode_GetMax()

diff --git a/pypy/module/cpyext/unicodeobject.py b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -155,6 +155,11 @@
     except KeyError:
         return -1.0
+ at cpython_api([], Py_UNICODE, error=CANNOT_FAIL)
+def PyUnicode_GetMax(space):
+    """Get the maximum ordinal for a Unicode character."""
+    return unichr(runicode.MAXUNICODE)
 @cpython_api([PyObject], rffi.CCHARP, error=CANNOT_FAIL)
 def PyUnicode_AS_DATA(space, ref):
     """Return a pointer to the internal buffer of the object. o has to be a

More information about the pypy-commit mailing list