Commit db6c7f5c authored by Georg Brandl's avatar Georg Brandl

Update C API docs for PEP 393.

parent 59de0ee9
...@@ -100,6 +100,20 @@ All integers are implemented as "long" integer objects of arbitrary size. ...@@ -100,6 +100,20 @@ All integers are implemented as "long" integer objects of arbitrary size.
string is first encoded to a byte string using :c:func:`PyUnicode_EncodeDecimal` string is first encoded to a byte string using :c:func:`PyUnicode_EncodeDecimal`
and then converted using :c:func:`PyLong_FromString`. and then converted using :c:func:`PyLong_FromString`.
.. deprecated-removed:: 3.3 4.0
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
:c:func:`PyLong_FromUnicodeObject`.
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)
Convert a sequence of Unicode digits in the string *u* to a Python integer
value. The Unicode string is first encoded to a byte string using
:c:func:`PyUnicode_EncodeDecimal` and then converted using
:c:func:`PyLong_FromString`.
.. versionadded:: 3.3
.. c:function:: PyObject* PyLong_FromVoidPtr(void *p) .. c:function:: PyObject* PyLong_FromVoidPtr(void *p)
......
...@@ -87,7 +87,7 @@ There are only a few functions special to module objects. ...@@ -87,7 +87,7 @@ There are only a few functions special to module objects.
Return the name of the file from which *module* was loaded using *module*'s Return the name of the file from which *module* was loaded using *module*'s
:attr:`__file__` attribute. If this is not defined, or if it is not a :attr:`__file__` attribute. If this is not defined, or if it is not a
unicode string, raise :exc:`SystemError` and return *NULL*; otherwise return unicode string, raise :exc:`SystemError` and return *NULL*; otherwise return
a reference to a :c:type:`PyUnicodeObject`. a reference to a Unicode object.
.. versionadded:: 3.2 .. versionadded:: 3.2
......
This diff is collapsed.
...@@ -686,7 +686,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Substring( ...@@ -686,7 +686,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Substring(
Py_ssize_t start, Py_ssize_t start,
Py_ssize_t end); Py_ssize_t end);
/* Copy the string into a UCS4 buffer including the null character is copy_null /* Copy the string into a UCS4 buffer including the null character if copy_null
is set. Return NULL and raise an exception on error. Raise a ValueError if is set. Return NULL and raise an exception on error. Raise a ValueError if
the buffer is smaller than the string. Return buffer on success. the buffer is smaller than the string. Return buffer on success.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment