summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-02-03 05:13:24 (GMT)
committerSkip Montanaro <skip@pobox.com>2003-02-03 05:13:24 (GMT)
commit1ff49a7734265d3fdbf21e739ccd3f669b6f9820 (patch)
tree9ceca3609e11d440ef2e4a799c2fd05991771b82 /Doc/api
parent3ed7b03224384d28b96c73213d5c0e31a4b87fda (diff)
downloadcpython-1ff49a7734265d3fdbf21e739ccd3f669b6f9820.zip
cpython-1ff49a7734265d3fdbf21e739ccd3f669b6f9820.tar.gz
cpython-1ff49a7734265d3fdbf21e739ccd3f669b6f9820.tar.bz2
* Add description of PyInt_FromString.
* Correct description of PyFloat_FromString. While ignored, the pend argument still has to be given. * Typo in PyLong_FromString.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/concrete.tex26
1 files changed, 23 insertions, 3 deletions
diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex
index 6ac76dc..93a7bd2 100644
--- a/Doc/api/concrete.tex
+++ b/Doc/api/concrete.tex
@@ -129,6 +129,25 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
\versionadded{2.2}
\end{cfuncdesc}
+\begin{cfuncdesc}{PyObject*}{PyInt_FromString}{char *str, char **pend,
+ int base}
+ Return a new \ctype{PyIntObject} or \ctype{PyLongObject} based on the
+ string value in \var{str}, which is interpreted according to the radix in
+ \var{base}. If \var{pend} is non-\NULL, \code{*\var{pend}} will point to
+ the first character in \var{str} which follows the representation of the
+ number. If \var{base} is \code{0}, the radix will be determined based on
+ the leading characters of \var{str}: if \var{str} starts with \code{'0x'}
+ or \code{'0X'}, radix 16 will be used; if \var{str} starts with
+ \code{'0'}, radix 8 will be used; otherwise radix 10 will be used. If
+ \var{base} is not \code{0}, it must be between \code{2} and \code{36},
+ inclusive. Leading spaces are ignored. If there are no digits,
+ \exception{ValueError} will be raised. If the string represents a number
+ too large to be contained within the machine's \ctype{long int} type and
+ overflow warnings are being suppressed, a \ctype{PyLongObject} will be
+ returned. If overflow warnings are not being suppressed, \NULL{} will be
+ returned in this case.
+\end{cfuncdesc}
+
\begin{cfuncdesc}{PyObject*}{PyInt_FromLong}{long ival}
Creates a new integer object with a value of \var{ival}.
@@ -214,7 +233,7 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
\var{base}. If \var{pend} is non-\NULL, \code{*\var{pend}} will
point to the first character in \var{str} which follows the
representation of the number. If \var{base} is \code{0}, the radix
- will be determined base on the leading characters of \var{str}: if
+ will be determined based on the leading characters of \var{str}: if
\var{str} starts with \code{'0x'} or \code{'0X'}, radix 16 will be
used; if \var{str} starts with \code{'0'}, radix 8 will be used;
otherwise radix 10 will be used. If \var{base} is not \code{0}, it
@@ -317,9 +336,10 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
\versionadded{2.2}
\end{cfuncdesc}
-\begin{cfuncdesc}{PyObject*}{PyFloat_FromString}{PyObject *str}
+\begin{cfuncdesc}{PyObject*}{PyFloat_FromString}{PyObject *str, char **pend}
Creates a \ctype{PyFloatObject} object based on the string value in
- \var{str}, or \NULL{} on failure.
+ \var{str}, or \NULL{} on failure. The \var{pend} argument is ignored. It
+ remains only for backward compatibility.
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyFloat_FromDouble}{double v}