diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-04-27 18:14:39 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-04-27 18:14:39 (GMT) |
commit | fe4948bcefe247ca69e3d605eac1d9d4985e4cfd (patch) | |
tree | 73adbeefcc5d562c818511f5af349f2fd09ec8b8 /Doc | |
parent | 7a69b4b46415bdcb50a007c1f94f84b3ce821a3b (diff) | |
download | cpython-fe4948bcefe247ca69e3d605eac1d9d4985e4cfd.zip cpython-fe4948bcefe247ca69e3d605eac1d9d4985e4cfd.tar.gz cpython-fe4948bcefe247ca69e3d605eac1d9d4985e4cfd.tar.bz2 |
#2700 Document PyNumber_ToBase
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/number.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst index a79e406..3602287 100644 --- a/Doc/c-api/number.rst +++ b/Doc/c-api/number.rst @@ -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 |