Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3b197540
Commit
3b197540
authored
Mar 01, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document new Py_ssize_t API.
parent
8b87a0b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
Doc/api/concrete.tex
Doc/api/concrete.tex
+19
-1
Doc/api/utilities.tex
Doc/api/utilities.tex
+8
-0
No files found.
Doc/api/concrete.tex
View file @
3b197540
...
...
@@ -162,9 +162,20 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
suspect the behaviour of Python in this case is undefined. :-)
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyInt
_
FromSsize
_
t
}{
Py
_
ssize
_
t ival
}
Create a new integer object with a value of
\var
{
ival
}
.
If the value exceeds
\code
{
LONG
_
MAX
}
, a long integer object is
returned.
\versionadded
{
2.5
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
long
}{
PyInt
_
AsLong
}{
PyObject *io
}
Will first attempt to cast the object to a
\ctype
{
PyIntObject
}
, if
it is not already one, and then return its value.
it is not already one, and then return its value. If there is an
error,
\code
{
-1
}
is returned, and the caller should check
\code
{
PyErr
_
Occurred()
}
to find out whether there was an error, or
whether the value just happened to be -1.
\end{cfuncdesc}
\begin{cfuncdesc}
{
long
}{
PyInt
_
AS
_
LONG
}{
PyObject *io
}
...
...
@@ -186,6 +197,13 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
\versionadded
{
2.3
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
Py
_
ssize
_
t
}{
PyInt
_
AsSsize
_
t
}{
PyObject *io
}
Will first attempt to cast the object to a
\ctype
{
PyIntObject
}
or
\ctype
{
PyLongObject
}
, if it is not already one, and then return its
value as
\ctype
{
Py
_
ssize
_
t
}
.
\versionadded
{
2.5
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
long
}{
PyInt
_
GetMax
}{}
Return the system's idea of the largest integer it can handle
(
\constant
{
LONG
_
MAX
}
\ttindex
{
LONG
_
MAX
}
, as defined in the system
...
...
Doc/api/utilities.tex
View file @
3b197540
...
...
@@ -553,6 +553,10 @@ whose address should be passed.
platforms that support
\ctype
{
unsigned long long
}
(or
\ctype
{
unsigned
_
int64
}
on Windows).
\versionadded
{
2.3
}
\item
[\samp{n} (integer) {[Py_ssize_t]
}
]
Convert a Python integer or long integer to a C
\ctype
{
Py
_
ssize
_
t
}
.
\versionadded
{
2.5
}
\item
[\samp{c} (string of length 1) {[char]
}
]
Convert a Python character, represented as a string of length 1, to
a C
\ctype
{
char
}
.
...
...
@@ -866,6 +870,10 @@ PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
Convert a C
\ctype
{
unsigned long long
}
to a Python long integer object.
Only available on platforms that support
\ctype
{
unsigned long long
}
.
\item
[\samp{n} (int) {[Py_ssize_t]
}
]
Convert a C
\ctype
{
Py
_
ssize
_
t) to a Python integer or long integer.
\versionadded
{
2.5
}
\item
[\samp{c} (string of length 1) {[char]
}
]
Convert a C
\ctype
{
int
}
representing a character to a Python
string of length 1.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment