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
29fafd87
Commit
29fafd87
authored
Mar 01, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make documentation match the implementation.
parent
67d70eb9
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
168 additions
and
167 deletions
+168
-167
Doc/api/abstract.tex
Doc/api/abstract.tex
+24
-24
Doc/api/concrete.tex
Doc/api/concrete.tex
+99
-99
Doc/api/exceptions.tex
Doc/api/exceptions.tex
+6
-5
Doc/api/init.tex
Doc/api/init.tex
+1
-1
Doc/api/newtypes.tex
Doc/api/newtypes.tex
+26
-26
Doc/api/utilities.tex
Doc/api/utilities.tex
+12
-12
No files found.
Doc/api/abstract.tex
View file @
29fafd87
...
@@ -16,7 +16,7 @@ for which they do not apply, they will raise a Python exception.
...
@@ -16,7 +16,7 @@ for which they do not apply, they will raise a Python exception.
object is written instead of the
\function
{
repr()
}
.
object is written instead of the
\function
{
repr()
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyObject
_
HasAttrString
}{
PyObject *o, char *attr
_
name
}
\begin{cfuncdesc}
{
int
}{
PyObject
_
HasAttrString
}{
PyObject *o, c
onst c
har *attr
_
name
}
Returns
\code
{
1
}
if
\var
{
o
}
has the attribute
\var
{
attr
_
name
}
, and
Returns
\code
{
1
}
if
\var
{
o
}
has the attribute
\var
{
attr
_
name
}
, and
\code
{
0
}
otherwise. This is equivalent to the Python expression
\code
{
0
}
otherwise. This is equivalent to the Python expression
\samp
{
hasattr(
\var
{
o
}
,
\var
{
attr
_
name
}
)
}
. This function always
\samp
{
hasattr(
\var
{
o
}
,
\var
{
attr
_
name
}
)
}
. This function always
...
@@ -24,7 +24,7 @@ for which they do not apply, they will raise a Python exception.
...
@@ -24,7 +24,7 @@ for which they do not apply, they will raise a Python exception.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
GetAttrString
}{
PyObject *o,
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
GetAttrString
}{
PyObject *o,
char *attr
_
name
}
c
onst c
har *attr
_
name
}
Retrieve an attribute named
\var
{
attr
_
name
}
from object
\var
{
o
}
.
Retrieve an attribute named
\var
{
attr
_
name
}
from object
\var
{
o
}
.
Returns the attribute value on success, or
\NULL
{}
on failure.
Returns the attribute value on success, or
\NULL
{}
on failure.
This is the equivalent of the Python expression
This is the equivalent of the Python expression
...
@@ -50,7 +50,7 @@ for which they do not apply, they will raise a Python exception.
...
@@ -50,7 +50,7 @@ for which they do not apply, they will raise a Python exception.
\begin{cfuncdesc}
{
int
}{
PyObject
_
SetAttrString
}{
PyObject *o,
\begin{cfuncdesc}
{
int
}{
PyObject
_
SetAttrString
}{
PyObject *o,
char *attr
_
name, PyObject *v
}
c
onst c
har *attr
_
name, PyObject *v
}
Set the value of the attribute named
\var
{
attr
_
name
}
, for object
Set the value of the attribute named
\var
{
attr
_
name
}
, for object
\var
{
o
}
, to the value
\var
{
v
}
. Returns
\code
{
-1
}
on failure. This
\var
{
o
}
, to the value
\var
{
v
}
. Returns
\code
{
-1
}
on failure. This
is the equivalent of the Python statement
is the equivalent of the Python statement
...
@@ -67,7 +67,7 @@ for which they do not apply, they will raise a Python exception.
...
@@ -67,7 +67,7 @@ for which they do not apply, they will raise a Python exception.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyObject
_
DelAttrString
}{
PyObject *o, char *attr
_
name
}
\begin{cfuncdesc}
{
int
}{
PyObject
_
DelAttrString
}{
PyObject *o, c
onst c
har *attr
_
name
}
Delete attribute named
\var
{
attr
_
name
}
, for object
\var
{
o
}
. Returns
Delete attribute named
\var
{
attr
_
name
}
, for object
\var
{
o
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of the Python
\code
{
-1
}
on failure. This is the equivalent of the Python
statement:
\samp
{
del
\var
{
o
}
.
\var
{
attr
_
name
}}
.
statement:
\samp
{
del
\var
{
o
}
.
\var
{
attr
_
name
}}
.
...
@@ -301,7 +301,7 @@ determination.
...
@@ -301,7 +301,7 @@ determination.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyObject
_
Hash
}{
PyObject *o
}
\begin{cfuncdesc}
{
long
}{
PyObject
_
Hash
}{
PyObject *o
}
Compute and return the hash value of an object
\var
{
o
}
. On failure,
Compute and return the hash value of an object
\var
{
o
}
. On failure,
return
\code
{
-1
}
. This is the equivalent of the Python expression
return
\code
{
-1
}
. This is the equivalent of the Python expression
\samp
{
hash(
\var
{
o
}
)
}
.
\bifuncindex
{
hash
}
\samp
{
hash(
\var
{
o
}
)
}
.
\bifuncindex
{
hash
}
...
@@ -340,8 +340,8 @@ determination.
...
@@ -340,8 +340,8 @@ determination.
\versionadded
{
2.2
}
\versionadded
{
2.2
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
in
t
}{
PyObject
_
Length
}{
PyObject *o
}
\begin{cfuncdesc}
{
Py
_
ssize
_
t
}{
PyObject
_
Length
}{
PyObject *o
}
\cfuncline
{
in
t
}{
PyObject
_
Size
}{
PyObject *o
}
\cfuncline
{
Py
_
ssize
_
t
}{
PyObject
_
Size
}{
PyObject *o
}
Return the length of object
\var
{
o
}
. If the object
\var
{
o
}
provides
Return the length of object
\var
{
o
}
. If the object
\var
{
o
}
provides
either the sequence and mapping protocols, the sequence length is
either the sequence and mapping protocols, the sequence length is
returned. On error,
\code
{
-1
}
is returned. This is the equivalent
returned. On error,
\code
{
-1
}
is returned. This is the equivalent
...
@@ -697,14 +697,14 @@ determination.
...
@@ -697,14 +697,14 @@ determination.
\code
{
0
}
otherwise. This function always succeeds.
\code
{
0
}
otherwise. This function always succeeds.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
in
t
}{
PySequence
_
Size
}{
PyObject *o
}
\begin{cfuncdesc}
{
Py
_
ssize
_
t
}{
PySequence
_
Size
}{
PyObject *o
}
Returns the number of objects in sequence
\var
{
o
}
on success, and
Returns the number of objects in sequence
\var
{
o
}
on success, and
\code
{
-1
}
on failure. For objects that do not provide sequence
\code
{
-1
}
on failure. For objects that do not provide sequence
protocol, this is equivalent to the Python expression
protocol, this is equivalent to the Python expression
\samp
{
len(
\var
{
o
}
)
}
.
\bifuncindex
{
len
}
\samp
{
len(
\var
{
o
}
)
}
.
\bifuncindex
{
len
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
in
t
}{
PySequence
_
Length
}{
PyObject *o
}
\begin{cfuncdesc}
{
Py
_
ssize
_
t
}{
PySequence
_
Length
}{
PyObject *o
}
Alternate name for
\cfunction
{
PySequence
_
Size()
}
.
Alternate name for
\cfunction
{
PySequence
_
Size()
}
.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -715,7 +715,7 @@ determination.
...
@@ -715,7 +715,7 @@ determination.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
Repeat
}{
PyObject *o,
in
t count
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
Repeat
}{
PyObject *o,
Py
_
ssize
_
t count
}
Return the result of repeating sequence object
\var
{
o
}
\var
{
count
}
Return the result of repeating sequence object
\var
{
o
}
\var
{
count
}
times, or
\NULL
{}
on failure. This is the equivalent of the Python
times, or
\NULL
{}
on failure. This is the equivalent of the Python
expression
\samp
{
\var
{
o
}
*
\var
{
count
}}
.
expression
\samp
{
\var
{
o
}
*
\var
{
count
}}
.
...
@@ -730,7 +730,7 @@ determination.
...
@@ -730,7 +730,7 @@ determination.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
InPlaceRepeat
}{
PyObject *o,
in
t count
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
InPlaceRepeat
}{
PyObject *o,
Py
_
ssize
_
t count
}
Return the result of repeating sequence object
\var
{
o
}
\var
{
count
}
Return the result of repeating sequence object
\var
{
o
}
\var
{
count
}
times, or
\NULL
{}
on failure. The operation is done
\emph
{
in-place
}
times, or
\NULL
{}
on failure. The operation is done
\emph
{
in-place
}
when
\var
{
o
}
supports it. This is the equivalent of the Python
when
\var
{
o
}
supports it. This is the equivalent of the Python
...
@@ -738,41 +738,41 @@ determination.
...
@@ -738,41 +738,41 @@ determination.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
GetItem
}{
PyObject *o,
in
t i
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
GetItem
}{
PyObject *o,
Py
_
ssize
_
t i
}
Return the
\var
{
i
}
th element of
\var
{
o
}
, or
\NULL
{}
on failure.
Return the
\var
{
i
}
th element of
\var
{
o
}
, or
\NULL
{}
on failure.
This is the equivalent of the Python expression
This is the equivalent of the Python expression
\samp
{
\var
{
o
}
[
\var
{
i
}
]
}
.
\samp
{
\var
{
o
}
[
\var
{
i
}
]
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
GetSlice
}{
PyObject *o,
int i1, in
t i2
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
GetSlice
}{
PyObject *o,
Py
_
ssize
_
t i1, Py
_
ssize
_
t i2
}
Return the slice of sequence object
\var
{
o
}
between
\var
{
i1
}
and
Return the slice of sequence object
\var
{
o
}
between
\var
{
i1
}
and
\var
{
i2
}
, or
\NULL
{}
on failure. This is the equivalent of the
\var
{
i2
}
, or
\NULL
{}
on failure. This is the equivalent of the
Python expression
\samp
{
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
]
}
.
Python expression
\samp
{
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
]
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySequence
_
SetItem
}{
PyObject *o,
in
t i, PyObject *v
}
\begin{cfuncdesc}
{
int
}{
PySequence
_
SetItem
}{
PyObject *o,
Py
_
ssize
_
t i, PyObject *v
}
Assign object
\var
{
v
}
to the
\var
{
i
}
th element of
\var
{
o
}
. Returns
Assign object
\var
{
v
}
to the
\var
{
i
}
th element of
\var
{
o
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of the Python
\code
{
-1
}
on failure. This is the equivalent of the Python
statement
\samp
{
\var
{
o
}
[
\var
{
i
}
] =
\var
{
v
}}
. This function
\emph
{
does not
}
statement
\samp
{
\var
{
o
}
[
\var
{
i
}
] =
\var
{
v
}}
. This function
\emph
{
does not
}
steal a reference to
\var
{
v
}
.
steal a reference to
\var
{
v
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySequence
_
DelItem
}{
PyObject *o,
in
t i
}
\begin{cfuncdesc}
{
int
}{
PySequence
_
DelItem
}{
PyObject *o,
Py
_
ssize
_
t i
}
Delete the
\var
{
i
}
th element of object
\var
{
o
}
. Returns
\code
{
-1
}
Delete the
\var
{
i
}
th element of object
\var
{
o
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of the Python statement
on failure. This is the equivalent of the Python statement
\samp
{
del
\var
{
o
}
[
\var
{
i
}
]
}
.
\samp
{
del
\var
{
o
}
[
\var
{
i
}
]
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySequence
_
SetSlice
}{
PyObject *o,
in
t i1,
\begin{cfuncdesc}
{
int
}{
PySequence
_
SetSlice
}{
PyObject *o,
Py
_
ssize
_
t i1,
in
t i2, PyObject *v
}
Py
_
ssize
_
t i2, PyObject *v
}
Assign the sequence object
\var
{
v
}
to the slice in sequence object
Assign the sequence object
\var
{
v
}
to the slice in sequence object
\var
{
o
}
from
\var
{
i1
}
to
\var
{
i2
}
. This is the equivalent of the
\var
{
o
}
from
\var
{
i1
}
to
\var
{
i2
}
. This is the equivalent of the
Python statement
\samp
{
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
] =
\var
{
v
}}
.
Python statement
\samp
{
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
] =
\var
{
v
}}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySequence
_
DelSlice
}{
PyObject *o,
int i1, in
t i2
}
\begin{cfuncdesc}
{
int
}{
PySequence
_
DelSlice
}{
PyObject *o,
Py
_
ssize
_
t i1, Py
_
ssize
_
t i2
}
Delete the slice in sequence object
\var
{
o
}
from
\var
{
i1
}
to
Delete the slice in sequence object
\var
{
o
}
from
\var
{
i1
}
to
\var
{
i2
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of
\var
{
i2
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of
the Python statement
\samp
{
del
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
]
}
.
the Python statement
\samp
{
del
\var
{
o
}
[
\var
{
i1
}
:
\var
{
i2
}
]
}
.
...
@@ -821,7 +821,7 @@ determination.
...
@@ -821,7 +821,7 @@ determination.
text.
text.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
Fast
_
GET
_
ITEM
}{
PyObject *o,
in
t i
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
Fast
_
GET
_
ITEM
}{
PyObject *o,
Py
_
ssize
_
t i
}
Return the
\var
{
i
}
th element of
\var
{
o
}
, assuming that
\var
{
o
}
was
Return the
\var
{
i
}
th element of
\var
{
o
}
, assuming that
\var
{
o
}
was
returned by
\cfunction
{
PySequence
_
Fast()
}
,
\var
{
o
}
is not
\NULL
,
returned by
\cfunction
{
PySequence
_
Fast()
}
,
\var
{
o
}
is not
\NULL
,
and that
\var
{
i
}
is within bounds.
and that
\var
{
i
}
is within bounds.
...
@@ -834,7 +834,7 @@ determination.
...
@@ -834,7 +834,7 @@ determination.
\versionadded
{
2.4
}
\versionadded
{
2.4
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
ITEM
}{
PyObject *o,
in
t i
}
\begin{cfuncdesc}
{
PyObject*
}{
PySequence
_
ITEM
}{
PyObject *o,
Py
_
ssize
_
t i
}
Return the
\var
{
i
}
th element of
\var
{
o
}
or
\NULL
{}
on failure.
Return the
\var
{
i
}
th element of
\var
{
o
}
or
\NULL
{}
on failure.
Macro form of
\cfunction
{
PySequence
_
GetItem()
}
but without checking
Macro form of
\cfunction
{
PySequence
_
GetItem()
}
but without checking
that
\cfunction
{
PySequence
_
Check(
\var
{
o
}
)
}
is true and without
that
\cfunction
{
PySequence
_
Check(
\var
{
o
}
)
}
is true and without
...
@@ -860,7 +860,7 @@ determination.
...
@@ -860,7 +860,7 @@ determination.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
in
t
}{
PyMapping
_
Length
}{
PyObject *o
}
\begin{cfuncdesc}
{
Py
_
ssize
_
t
}{
PyMapping
_
Length
}{
PyObject *o
}
Returns the number of keys in object
\var
{
o
}
on success, and
Returns the number of keys in object
\var
{
o
}
on success, and
\code
{
-1
}
on failure. For objects that do not provide mapping
\code
{
-1
}
on failure. For objects that do not provide mapping
protocol, this is equivalent to the Python expression
protocol, this is equivalent to the Python expression
...
@@ -986,7 +986,7 @@ else {
...
@@ -986,7 +986,7 @@ else {
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsCharBuffer
}{
PyObject *obj,
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsCharBuffer
}{
PyObject *obj,
const char **buffer,
const char **buffer,
in
t *buffer
_
len
}
Py
_
ssize
_
t *buffer
_
len
}
Returns a pointer to a read-only memory location useable as character-
Returns a pointer to a read-only memory location useable as character-
based input. The
\var
{
obj
}
argument must support the single-segment
based input. The
\var
{
obj
}
argument must support the single-segment
character buffer interface. On success, returns
\code
{
0
}
, sets
character buffer interface. On success, returns
\code
{
0
}
, sets
...
@@ -997,7 +997,7 @@ else {
...
@@ -997,7 +997,7 @@ else {
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsReadBuffer
}{
PyObject *obj,
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsReadBuffer
}{
PyObject *obj,
const void **buffer,
const void **buffer,
in
t *buffer
_
len
}
Py
_
ssize
_
t *buffer
_
len
}
Returns a pointer to a read-only memory location containing
Returns a pointer to a read-only memory location containing
arbitrary data. The
\var
{
obj
}
argument must support the
arbitrary data. The
\var
{
obj
}
argument must support the
single-segment readable buffer interface. On success, returns
single-segment readable buffer interface. On success, returns
...
@@ -1015,7 +1015,7 @@ else {
...
@@ -1015,7 +1015,7 @@ else {
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsWriteBuffer
}{
PyObject *obj,
\begin{cfuncdesc}
{
int
}{
PyObject
_
AsWriteBuffer
}{
PyObject *obj,
void **buffer,
void **buffer,
in
t *buffer
_
len
}
Py
_
ssize
_
t *buffer
_
len
}
Returns a pointer to a writeable memory location. The
\var
{
obj
}
Returns a pointer to a writeable memory location. The
\var
{
obj
}
argument must support the single-segment, character buffer
argument must support the single-segment, character buffer
interface. On success, returns
\code
{
0
}
, sets
\var
{
buffer
}
to the
interface. On success, returns
\code
{
0
}
, sets
\var
{
buffer
}
to the
...
...
Doc/api/concrete.tex
View file @
29fafd87
This diff is collapsed.
Click to expand it.
Doc/api/exceptions.tex
View file @
29fafd87
...
@@ -113,7 +113,7 @@ for each thread.
...
@@ -113,7 +113,7 @@ for each thread.
exception state.
}
exception state.
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
void
}{
PyErr
_
SetString
}{
PyObject *type, char *message
}
\begin{cfuncdesc}
{
void
}{
PyErr
_
SetString
}{
PyObject *type, c
onst c
har *message
}
This is the most common way to set the error indicator. The first
This is the most common way to set the error indicator. The first
argument specifies the exception type; it is normally one of the
argument specifies the exception type; it is normally one of the
standard exceptions, e.g.
\cdata
{
PyExc
_
RuntimeError
}
. You need not
standard exceptions, e.g.
\cdata
{
PyExc
_
RuntimeError
}
. You need not
...
@@ -184,7 +184,7 @@ for each thread.
...
@@ -184,7 +184,7 @@ for each thread.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyErr
_
SetFromErrnoWithFilename
}{
PyObject *type,
\begin{cfuncdesc}
{
PyObject*
}{
PyErr
_
SetFromErrnoWithFilename
}{
PyObject *type,
char *filename
}
c
onst c
har *filename
}
Similar to
\cfunction
{
PyErr
_
SetFromErrno()
}
, with the additional
Similar to
\cfunction
{
PyErr
_
SetFromErrno()
}
, with the additional
behavior that if
\var
{
filename
}
is not
\NULL
, it is passed to the
behavior that if
\var
{
filename
}
is not
\NULL
, it is passed to the
constructor of
\var
{
type
}
as a third parameter. In the case of
constructor of
\var
{
type
}
as a third parameter. In the case of
...
@@ -217,7 +217,7 @@ for each thread.
...
@@ -217,7 +217,7 @@ for each thread.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyErr
_
SetFromWindowsErrWithFilename
}{
int ierr,
\begin{cfuncdesc}
{
PyObject*
}{
PyErr
_
SetFromWindowsErrWithFilename
}{
int ierr,
char *filename
}
c
onst c
har *filename
}
Similar to
\cfunction
{
PyErr
_
SetFromWindowsErr()
}
, with the
Similar to
\cfunction
{
PyErr
_
SetFromWindowsErr()
}
, with the
additional behavior that if
\var
{
filename
}
is not
\NULL
, it is
additional behavior that if
\var
{
filename
}
is not
\NULL
, it is
passed to the constructor of
\exception
{
WindowsError
}
as a third
passed to the constructor of
\exception
{
WindowsError
}
as a third
...
@@ -275,8 +275,9 @@ for each thread.
...
@@ -275,8 +275,9 @@ for each thread.
command line documentation. There is no C API for warning control.
command line documentation. There is no C API for warning control.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyErr
_
WarnExplicit
}{
PyObject *category, char *message,
\begin{cfuncdesc}
{
int
}{
PyErr
_
WarnExplicit
}{
PyObject *category,
char *filename, int lineno, char *module, PyObject *registry
}
const char *message, const char *filename, int lineno,
const char *module, PyObject *registry
}
Issue a warning message with explicit control over all warning
Issue a warning message with explicit control over all warning
attributes. This is a straightforward wrapper around the Python
attributes. This is a straightforward wrapper around the Python
function
\function
{
warnings.warn
_
explicit()
}
, see there for more
function
\function
{
warnings.warn
_
explicit()
}
, see there for more
...
...
Doc/api/init.tex
View file @
29fafd87
...
@@ -331,7 +331,7 @@
...
@@ -331,7 +331,7 @@
\withsubitem
{
(in module sys)
}{
\ttindex
{
version
}}
\withsubitem
{
(in module sys)
}{
\ttindex
{
version
}}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySys
_
SetArgv
}{
int argc, char **argv
}
\begin{cfuncdesc}
{
void
}{
PySys
_
SetArgv
}{
int argc, char **argv
}
Set
\code
{
sys.argv
}
based on
\var
{
argc
}
and
\var
{
argv
}
. These
Set
\code
{
sys.argv
}
based on
\var
{
argc
}
and
\var
{
argv
}
. These
parameters are similar to those passed to the program's
parameters are similar to those passed to the program's
\cfunction
{
main()
}
\ttindex
{
main()
}
function with the difference that
\cfunction
{
main()
}
\ttindex
{
main()
}
function with the difference that
...
...
Doc/api/newtypes.tex
View file @
29fafd87
...
@@ -11,7 +11,7 @@ defining new object types.
...
@@ -11,7 +11,7 @@ defining new object types.
\begin{cfuncdesc}
{
PyObject*
}{_
PyObject
_
New
}{
PyTypeObject *type
}
\begin{cfuncdesc}
{
PyObject*
}{_
PyObject
_
New
}{
PyTypeObject *type
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyVarObject*
}{_
PyObject
_
NewVar
}{
PyTypeObject *type,
in
t size
}
\begin{cfuncdesc}
{
PyVarObject*
}{_
PyObject
_
NewVar
}{
PyTypeObject *type,
Py
_
ssize
_
t size
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
void
}{_
PyObject
_
Del
}{
PyObject *op
}
\begin{cfuncdesc}
{
void
}{_
PyObject
_
Del
}{
PyObject *op
}
...
@@ -27,7 +27,7 @@ defining new object types.
...
@@ -27,7 +27,7 @@ defining new object types.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyVarObject*
}{
PyObject
_
InitVar
}{
PyVarObject *op,
\begin{cfuncdesc}
{
PyVarObject*
}{
PyObject
_
InitVar
}{
PyVarObject *op,
PyTypeObject *type,
in
t size
}
PyTypeObject *type,
Py
_
ssize
_
t size
}
This does everything
\cfunction
{
PyObject
_
Init()
}
does, and also
This does everything
\cfunction
{
PyObject
_
Init()
}
does, and also
initializes the length information for a variable-size object.
initializes the length information for a variable-size object.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -42,7 +42,7 @@ defining new object types.
...
@@ -42,7 +42,7 @@ defining new object types.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
NewVar
}{
TYPE, PyTypeObject *type,
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
NewVar
}{
TYPE, PyTypeObject *type,
in
t size
}
Py
_
ssize
_
t size
}
Allocate a new Python object using the C structure type
\var
{
TYPE
}
Allocate a new Python object using the C structure type
\var
{
TYPE
}
and the Python type object
\var
{
type
}
. Fields not defined by the
and the Python type object
\var
{
type
}
. Fields not defined by the
Python object header are not initialized. The allocated memory
Python object header are not initialized. The allocated memory
...
@@ -69,7 +69,7 @@ defining new object types.
...
@@ -69,7 +69,7 @@ defining new object types.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
NEW
_
VAR
}{
TYPE, PyTypeObject *type,
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
NEW
_
VAR
}{
TYPE, PyTypeObject *type,
in
t size
}
Py
_
ssize
_
t size
}
Macro version of
\cfunction
{
PyObject
_
NewVar()
}
, to gain performance
Macro version of
\cfunction
{
PyObject
_
NewVar()
}
, to gain performance
at the expense of safety. This does not check
\var
{
type
}
for a
at the expense of safety. This does not check
\var
{
type
}
for a
\NULL
{}
value.
\NULL
{}
value.
...
@@ -170,13 +170,13 @@ These macros are used in the definition of \ctype{PyObject} and
...
@@ -170,13 +170,13 @@ These macros are used in the definition of \ctype{PyObject} and
\csimplemacro
{
Py
_
TRACE
_
REFS
}
. By default, that macro is not
\csimplemacro
{
Py
_
TRACE
_
REFS
}
. By default, that macro is not
defined, and
\csimplemacro
{
PyObject
_
HEAD
}
expands to:
defined, and
\csimplemacro
{
PyObject
_
HEAD
}
expands to:
\begin{verbatim}
\begin{verbatim}
in
t ob
_
refcnt;
Py
_
ssize
_
t ob
_
refcnt;
PyTypeObject *ob
_
type;
PyTypeObject *ob
_
type;
\end{verbatim}
\end{verbatim}
When
\csimplemacro
{
Py
_
TRACE
_
REFS
}
is defined, it expands to:
When
\csimplemacro
{
Py
_
TRACE
_
REFS
}
is defined, it expands to:
\begin{verbatim}
\begin{verbatim}
PyObject *
_
ob
_
next, *
_
ob
_
prev;
PyObject *
_
ob
_
next, *
_
ob
_
prev;
in
t ob
_
refcnt;
Py
_
ssize
_
t ob
_
refcnt;
PyTypeObject *ob
_
type;
PyTypeObject *ob
_
type;
\end{verbatim}
\end{verbatim}
\end{csimplemacrodesc}
\end{csimplemacrodesc}
...
@@ -383,7 +383,7 @@ objects) \emph{must} have the \member{ob_size} field.
...
@@ -383,7 +383,7 @@ objects) \emph{must} have the \member{ob_size} field.
These fields are not inherited by subtypes.
These fields are not inherited by subtypes.
\end{cmemberdesc}
\end{cmemberdesc}
\begin{cmemberdesc}
{
PyObject
}{
in
t
}{
ob
_
refcnt
}
\begin{cmemberdesc}
{
PyObject
}{
Py
_
ssize
_
t
}{
ob
_
refcnt
}
This is the type object's reference count, initialized to
\code
{
1
}
This is the type object's reference count, initialized to
\code
{
1
}
by the
\code
{
PyObject
_
HEAD
_
INIT
}
macro. Note that for statically
by the
\code
{
PyObject
_
HEAD
_
INIT
}
macro. Note that for statically
allocated type objects, the type's instances (objects whose
allocated type objects, the type's instances (objects whose
...
@@ -421,7 +421,7 @@ Foo_Type.ob_type = &PyType_Type;
...
@@ -421,7 +421,7 @@ Foo_Type.ob_type = &PyType_Type;
and in 2.3 and beyond, it is inherited by subtypes.
and in 2.3 and beyond, it is inherited by subtypes.
\end{cmemberdesc}
\end{cmemberdesc}
\begin{cmemberdesc}
{
PyVarObject
}{
in
t
}{
ob
_
size
}
\begin{cmemberdesc}
{
PyVarObject
}{
Py
_
ssize
_
t
}{
ob
_
size
}
For statically allocated type objects, this should be initialized
For statically allocated type objects, this should be initialized
to zero. For dynamically allocated type objects, this field has a
to zero. For dynamically allocated type objects, this field has a
special internal meaning.
special internal meaning.
...
@@ -457,8 +457,8 @@ Foo_Type.ob_type = &PyType_Type;
...
@@ -457,8 +457,8 @@ Foo_Type.ob_type = &PyType_Type;
This field is not inherited by subtypes.
This field is not inherited by subtypes.
\end{cmemberdesc}
\end{cmemberdesc}
\begin{cmemberdesc}
{
PyTypeObject
}{
in
t
}{
tp
_
basicsize
}
\begin{cmemberdesc}
{
PyTypeObject
}{
Py
_
ssize
_
t
}{
tp
_
basicsize
}
\cmemberline
{
PyTypeObject
}{
in
t
}{
tp
_
itemsize
}
\cmemberline
{
PyTypeObject
}{
Py
_
ssize
_
t
}{
tp
_
itemsize
}
These fields allow calculating the size in bytes of instances of
These fields allow calculating the size in bytes of instances of
the type.
the type.
...
@@ -1234,7 +1234,7 @@ int tp_init(PyObject *self, PyObject *args, PyObject *kwds)
...
@@ -1234,7 +1234,7 @@ int tp_init(PyObject *self, PyObject *args, PyObject *kwds)
The function signature is
The function signature is
\begin{verbatim}
\begin{verbatim}
PyObject *tp
_
alloc(PyTypeObject *self,
in
t nitems)
PyObject *tp
_
alloc(PyTypeObject *self,
Py
_
ssize
_
t nitems)
\end{verbatim}
\end{verbatim}
The purpose of this function is to separate memory allocation from
The purpose of this function is to separate memory allocation from
...
@@ -1386,15 +1386,15 @@ The remaining fields are only defined if the feature test macro
...
@@ -1386,15 +1386,15 @@ The remaining fields are only defined if the feature test macro
They are documented here for completeness. None of these fields are
They are documented here for completeness. None of these fields are
inherited by subtypes.
inherited by subtypes.
\begin{cmemberdesc}
{
PyTypeObject
}{
in
t
}{
tp
_
allocs
}
\begin{cmemberdesc}
{
PyTypeObject
}{
Py
_
ssize
_
t
}{
tp
_
allocs
}
Number of allocations.
Number of allocations.
\end{cmemberdesc}
\end{cmemberdesc}
\begin{cmemberdesc}
{
PyTypeObject
}{
in
t
}{
tp
_
frees
}
\begin{cmemberdesc}
{
PyTypeObject
}{
Py
_
ssize
_
t
}{
tp
_
frees
}
Number of frees.
Number of frees.
\end{cmemberdesc}
\end{cmemberdesc}
\begin{cmemberdesc}
{
PyTypeObject
}{
in
t
}{
tp
_
maxalloc
}
\begin{cmemberdesc}
{
PyTypeObject
}{
Py
_
ssize
_
t
}{
tp
_
maxalloc
}
Maximum simultaneously allocated objects.
Maximum simultaneously allocated objects.
\end{cmemberdesc}
\end{cmemberdesc}
...
@@ -1509,8 +1509,8 @@ to be able to test for its presence before using it.}
...
@@ -1509,8 +1509,8 @@ to be able to test for its presence before using it.}
\member
{
bf
_
getcharbuffer
}
slot is non-
\NULL
.
\member
{
bf
_
getcharbuffer
}
slot is non-
\NULL
.
\end{datadesc}
\end{datadesc}
\begin{ctypedesc}
[getreadbufferproc]
{
int (*get
readbufferproc)
\begin{ctypedesc}
[getreadbufferproc]
{
Py
_
ssize
_
t (*
readbufferproc)
(PyObject *self,
in
t segment, void **ptrptr)
}
(PyObject *self,
Py
_
ssize
_
t segment, void **ptrptr)
}
Return a pointer to a readable segment of the buffer. This function
Return a pointer to a readable segment of the buffer. This function
is allowed to raise an exception, in which case it must return
is allowed to raise an exception, in which case it must return
\code
{
-1
}
. The
\var
{
segment
}
which is passed must be zero or
\code
{
-1
}
. The
\var
{
segment
}
which is passed must be zero or
...
@@ -1520,8 +1520,8 @@ to be able to test for its presence before using it.}
...
@@ -1520,8 +1520,8 @@ to be able to test for its presence before using it.}
pointer to that memory.
pointer to that memory.
\end{ctypedesc}
\end{ctypedesc}
\begin{ctypedesc}
[getwritebufferproc]
{
int (*get
writebufferproc)
\begin{ctypedesc}
[getwritebufferproc]
{
Py
_
ssize
_
t (*
writebufferproc)
(PyObject *self,
in
t segment, void **ptrptr)
}
(PyObject *self,
Py
_
ssize
_
t segment, void **ptrptr)
}
Return a pointer to a writable memory buffer in
Return a pointer to a writable memory buffer in
\code
{
*
\var
{
ptrptr
}}
, and the length of that segment as the function
\code
{
*
\var
{
ptrptr
}}
, and the length of that segment as the function
return value. The memory buffer must correspond to buffer segment
return value. The memory buffer must correspond to buffer segment
...
@@ -1535,16 +1535,16 @@ to be able to test for its presence before using it.}
...
@@ -1535,16 +1535,16 @@ to be able to test for its presence before using it.}
% code.
% code.
\end{ctypedesc}
\end{ctypedesc}
\begin{ctypedesc}
[getsegcountproc]
{
int (*get
segcountproc)
\begin{ctypedesc}
[getsegcountproc]
{
Py
_
ssize
_
t (*
segcountproc)
(PyObject *self,
in
t *lenp)
}
(PyObject *self,
Py
_
ssize
_
t *lenp)
}
Return the number of memory segments which comprise the buffer. If
Return the number of memory segments which comprise the buffer. If
\var
{
lenp
}
is not
\NULL
, the implementation must report the sum of
\var
{
lenp
}
is not
\NULL
, the implementation must report the sum of
the sizes (in bytes) of all segments in
\code
{
*
\var
{
lenp
}}
.
the sizes (in bytes) of all segments in
\code
{
*
\var
{
lenp
}}
.
The function cannot fail.
The function cannot fail.
\end{ctypedesc}
\end{ctypedesc}
\begin{ctypedesc}
[getcharbufferproc]
{
int (*get
charbufferproc)
\begin{ctypedesc}
[getcharbufferproc]
{
Py
_
ssize
_
t (*
charbufferproc)
(PyObject *self,
in
t segment, const char **ptrptr)
}
(PyObject *self,
Py
_
ssize
_
t segment, const char **ptrptr)
}
Return the size of the memory buffer in
\var
{
ptrptr
}
for segment
Return the size of the memory buffer in
\var
{
ptrptr
}
for segment
\var
{
segment
}
.
\code
{
*
\var
{
ptrptr
}}
is set to the memory buffer.
\var
{
segment
}
.
\code
{
*
\var
{
ptrptr
}}
is set to the memory buffer.
\end{ctypedesc}
\end{ctypedesc}
...
@@ -1599,12 +1599,12 @@ Constructors for container types must conform to two rules:
...
@@ -1599,12 +1599,12 @@ Constructors for container types must conform to two rules:
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
GC
_
NewVar
}{
TYPE, PyTypeObject *type,
\begin{cfuncdesc}
{
\var
{
TYPE
}
*
}{
PyObject
_
GC
_
NewVar
}{
TYPE, PyTypeObject *type,
in
t size
}
Py
_
ssize
_
t size
}
Analogous to
\cfunction
{
PyObject
_
NewVar()
}
but for container objects
Analogous to
\cfunction
{
PyObject
_
NewVar()
}
but for container objects
with the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag set.
with the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag set.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyVarObject *
}{
PyObject
_
GC
_
Resize
}{
PyVarObject *op,
in
t
}
\begin{cfuncdesc}
{
PyVarObject *
}{
PyObject
_
GC
_
Resize
}{
PyVarObject *op,
Py
_
ssize
_
t
}
Resize an object allocated by
\cfunction
{
PyObject
_
NewVar()
}
. Returns
Resize an object allocated by
\cfunction
{
PyObject
_
NewVar()
}
. Returns
the resized object or
\NULL
{}
on failure.
the resized object or
\NULL
{}
on failure.
\end{cfuncdesc}
\end{cfuncdesc}
...
@@ -1633,12 +1633,12 @@ pair of rules:
...
@@ -1633,12 +1633,12 @@ pair of rules:
\cfunction
{
PyObject
_
GC
_
Del()
}
.
\cfunction
{
PyObject
_
GC
_
Del()
}
.
\end{enumerate}
\end{enumerate}
\begin{cfuncdesc}
{
void
}{
PyObject
_
GC
_
Del
}{
PyObject
*op
}
\begin{cfuncdesc}
{
void
}{
PyObject
_
GC
_
Del
}{
void
*op
}
Releases memory allocated to an object using
Releases memory allocated to an object using
\cfunction
{
PyObject
_
GC
_
New()
}
or
\cfunction
{
PyObject
_
GC
_
NewVar()
}
.
\cfunction
{
PyObject
_
GC
_
New()
}
or
\cfunction
{
PyObject
_
GC
_
NewVar()
}
.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
void
}{
PyObject
_
GC
_
UnTrack
}{
PyObject
*op
}
\begin{cfuncdesc}
{
void
}{
PyObject
_
GC
_
UnTrack
}{
void
*op
}
Remove the object
\var
{
op
}
from the set of container objects tracked
Remove the object
\var
{
op
}
from the set of container objects tracked
by the collector. Note that
\cfunction
{
PyObject
_
GC
_
Track()
}
can be
by the collector. Note that
\cfunction
{
PyObject
_
GC
_
Track()
}
can be
called again on this object to add it back to the set of tracked
called again on this object to add it back to the set of tracked
...
...
Doc/api/utilities.tex
View file @
29fafd87
...
@@ -8,7 +8,7 @@ values from C values.
...
@@ -8,7 +8,7 @@ values from C values.
\section
{
Operating System Utilities
\label
{
os
}}
\section
{
Operating System Utilities
\label
{
os
}}
\begin{cfuncdesc}
{
int
}{
Py
_
FdIsInteractive
}{
FILE *fp, char *filename
}
\begin{cfuncdesc}
{
int
}{
Py
_
FdIsInteractive
}{
FILE *fp, c
onst c
har *filename
}
Return true (nonzero) if the standard I/O file
\var
{
fp
}
with name
Return true (nonzero) if the standard I/O file
\var
{
fp
}
with name
\var
{
filename
}
is deemed interactive. This is the case for files
\var
{
filename
}
is deemed interactive. This is the case for files
for which
\samp
{
isatty(fileno(
\var
{
fp
}
))
}
is true. If the global
for which
\samp
{
isatty(fileno(
\var
{
fp
}
))
}
is true. If the global
...
@@ -91,7 +91,7 @@ values from C values.
...
@@ -91,7 +91,7 @@ values from C values.
\section
{
Importing Modules
\label
{
importing
}}
\section
{
Importing Modules
\label
{
importing
}}
\begin{cfuncdesc}
{
PyObject*
}{
PyImport
_
ImportModule
}{
char *name
}
\begin{cfuncdesc}
{
PyObject*
}{
PyImport
_
ImportModule
}{
c
onst c
har *name
}
This is a simplified interface to
This is a simplified interface to
\cfunction
{
PyImport
_
ImportModuleEx()
}
below, leaving the
\cfunction
{
PyImport
_
ImportModuleEx()
}
below, leaving the
\var
{
globals
}
and
\var
{
locals
}
arguments set to
\NULL
. When the
\var
{
globals
}
and
\var
{
locals
}
arguments set to
\NULL
. When the
...
@@ -148,7 +148,7 @@ values from C values.
...
@@ -148,7 +148,7 @@ values from C values.
case).
case).
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyImport
_
AddModule
}{
char *name
}
\begin{cfuncdesc}
{
PyObject*
}{
PyImport
_
AddModule
}{
c
onst c
har *name
}
Return the module object corresponding to a module name. The
Return the module object corresponding to a module name. The
\var
{
name
}
argument may be of the form
\code
{
package.module
}
.
\var
{
name
}
argument may be of the form
\code
{
package.module
}
.
First check the modules dictionary if there's one there, and if not,
First check the modules dictionary if there's one there, and if not,
...
@@ -369,7 +369,7 @@ Should only non-negative values be written using these routines?
...
@@ -369,7 +369,7 @@ Should only non-negative values be written using these routines?
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyMarshal
_
ReadObjectFromString
}{
char *string,
\begin{cfuncdesc}
{
PyObject*
}{
PyMarshal
_
ReadObjectFromString
}{
char *string,
in
t len
}
Py
_
ssize
_
t len
}
Return a Python object from the data stream in a character buffer
Return a Python object from the data stream in a character buffer
containing
\var
{
len
}
bytes pointed to by
\var
{
string
}
. On error,
containing
\var
{
len
}
bytes pointed to by
\var
{
string
}
. On error,
sets the appropriate exception (
\exception
{
EOFError
}
or
sets the appropriate exception (
\exception
{
EOFError
}
or
...
@@ -687,21 +687,21 @@ format and the format must be exhausted. On success, the
...
@@ -687,21 +687,21 @@ format and the format must be exhausted. On success, the
\cfunction
{
PyArg
_
Parse*()
}
functions return true, otherwise they
\cfunction
{
PyArg
_
Parse*()
}
functions return true, otherwise they
return false and raise an appropriate exception.
return false and raise an appropriate exception.
\begin{cfuncdesc}
{
int
}{
PyArg
_
ParseTuple
}{
PyObject *args, char *format,
\begin{cfuncdesc}
{
int
}{
PyArg
_
ParseTuple
}{
PyObject *args, c
onst c
har *format,
\moreargs
}
\moreargs
}
Parse the parameters of a function that takes only positional
Parse the parameters of a function that takes only positional
parameters into local variables. Returns true on success; on
parameters into local variables. Returns true on success; on
failure, it returns false and raises the appropriate exception.
failure, it returns false and raises the appropriate exception.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyArg
_
VaParse
}{
PyObject *args, char *format,
\begin{cfuncdesc}
{
int
}{
PyArg
_
VaParse
}{
PyObject *args, c
onst c
har *format,
va
_
list vargs
}
va
_
list vargs
}
Identical to
\cfunction
{
PyArg
_
ParseTuple()
}
, except that it accepts a
Identical to
\cfunction
{
PyArg
_
ParseTuple()
}
, except that it accepts a
va
_
list rather than a variable number of arguments.
va
_
list rather than a variable number of arguments.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyArg
_
ParseTupleAndKeywords
}{
PyObject *args,
\begin{cfuncdesc}
{
int
}{
PyArg
_
ParseTupleAndKeywords
}{
PyObject *args,
PyObject *kw, char *format, char *keywords[],
PyObject *kw, c
onst c
har *format, char *keywords[],
\moreargs
}
\moreargs
}
Parse the parameters of a function that takes both positional and
Parse the parameters of a function that takes both positional and
keyword parameters into local variables. Returns true on success;
keyword parameters into local variables. Returns true on success;
...
@@ -709,13 +709,13 @@ return false and raise an appropriate exception.
...
@@ -709,13 +709,13 @@ return false and raise an appropriate exception.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyArg
_
VaParseTupleAndKeywords
}{
PyObject *args,
\begin{cfuncdesc}
{
int
}{
PyArg
_
VaParseTupleAndKeywords
}{
PyObject *args,
PyObject *kw, char *format, char *keywords[],
PyObject *kw, c
onst c
har *format, char *keywords[],
va
_
list vargs
}
va
_
list vargs
}
Identical to
\cfunction
{
PyArg
_
ParseTupleAndKeywords()
}
, except that it
Identical to
\cfunction
{
PyArg
_
ParseTupleAndKeywords()
}
, except that it
accepts a va
_
list rather than a variable number of arguments.
accepts a va
_
list rather than a variable number of arguments.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyArg
_
Parse
}{
PyObject *args, char *format,
\begin{cfuncdesc}
{
int
}{
PyArg
_
Parse
}{
PyObject *args, c
onst c
har *format,
\moreargs
}
\moreargs
}
Function used to deconstruct the argument lists of ``old-style''
Function used to deconstruct the argument lists of ``old-style''
functions --- these are functions which use the
functions --- these are functions which use the
...
@@ -727,8 +727,8 @@ return false and raise an appropriate exception.
...
@@ -727,8 +727,8 @@ return false and raise an appropriate exception.
purpose.
purpose.
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyArg
_
UnpackTuple
}{
PyObject *args, char *name,
\begin{cfuncdesc}
{
int
}{
PyArg
_
UnpackTuple
}{
PyObject *args, c
onst c
har *name,
int min, in
t max,
\moreargs
}
Py
_
ssize
_
t min, Py
_
ssize
_
t max,
\moreargs
}
A simpler form of parameter retrieval which does not use a format
A simpler form of parameter retrieval which does not use a format
string to specify the types of the arguments. Functions which use
string to specify the types of the arguments. Functions which use
this method to retrieve their parameters should be declared as
this method to retrieve their parameters should be declared as
...
@@ -774,7 +774,7 @@ PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
...
@@ -774,7 +774,7 @@ PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
\versionadded
{
2.2
}
\versionadded
{
2.2
}
\end{cfuncdesc}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
Py
_
BuildValue
}{
char *format,
\begin{cfuncdesc}
{
PyObject*
}{
Py
_
BuildValue
}{
c
onst c
har *format,
\moreargs
}
\moreargs
}
Create a new value based on a format string similar to those
Create a new value based on a format string similar to those
accepted by the
\cfunction
{
PyArg
_
Parse*()
}
family of functions and a
accepted by the
\cfunction
{
PyArg
_
Parse*()
}
family of functions and a
...
...
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