#2700 Document PyNumber_ToBase

This commit is contained in:
Benjamin Peterson 2008-04-27 18:14:39 +00:00
parent 7a69b4b464
commit fe4948bcef
1 changed files with 11 additions and 0 deletions

View File

@ -290,6 +290,17 @@ Number Protocol
.. 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