[Python-checkins] r62535 - python/trunk/Doc/c-api/number.rst
benjamin.peterson
python-checkins at python.org
Sun Apr 27 20:14:39 CEST 2008
Author: benjamin.peterson
Date: Sun Apr 27 20:14:39 2008
New Revision: 62535
Log:
#2700 Document PyNumber_ToBase
Modified:
python/trunk/Doc/c-api/number.rst
Modified: python/trunk/Doc/c-api/number.rst
==============================================================================
--- python/trunk/Doc/c-api/number.rst (original)
+++ python/trunk/Doc/c-api/number.rst Sun Apr 27 20:14:39 2008
@@ -290,6 +290,17 @@
.. versionadded:: 2.5
+.. cfunction:: PyObject* PyNumber_ToBase(PyObject *n, int base)
+
+ Returns the the integer *n* converted to *base* as a string with a base
+ marker of ``'0b'``, ``'0o'``, or ``'0x'`` if appended applicable. When
+ *base* is not 2, 8, 10, or 16, the format is ``'x#num'`` where x is the
+ base. If *n* is not an int object, it is converted with
+ :cfunc:`PyNumber_Index` first.
+
+ .. versionadded:: 2.6
+
+
.. cfunction:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
More information about the Python-checkins
mailing list