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
5566c1ce
Commit
5566c1ce
authored
Jan 19, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bunch of typos caught by Gilles Civario.
parent
0fe5af9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
Doc/api/api.tex
Doc/api/api.tex
+20
-17
No files found.
Doc/api/api.tex
View file @
5566c1ce
...
...
@@ -888,7 +888,7 @@ You need not increment its reference count.
const char *format,
\moreargs
}
This function sets the error indicator.
\var
{
exception
}
should be a
Python exception (string or class, not an instance).
\var
{
f
m
t
}
should be a string, containing format codes, similar to
\var
{
f
orma
t
}
should be a string, containing format codes, similar to
\cfunction
{
printf
}
. The
\code
{
width.precision
}
before a format code
is parsed, but the width part is ignored.
...
...
@@ -947,7 +947,7 @@ argument. It is mostly for internal use.
\begin{cfuncdesc}
{
int
}{
PyErr
_
Warn
}{
PyObject *category, char *message
}
Issue a warning message. The
\var
{
category
}
argument is a warning
category (see below) or NULL; the
\var
{
message
}
argument is a message
category (see below) or
\
NULL
; the
\var
{
message
}
argument is a message
string.
This function normally prints a warning message to
\var
{
sys.stderr
}
;
...
...
@@ -960,8 +960,9 @@ return value is \code{0} if no exception is raised, or \code{-1} if
an exception is raised. (It is not possible to determine whether a
warning message is actually printed, nor what the reason is for the
exception; this is intentional.) If an exception is raised, the
caller should do its normal exception handling (e.g. DECREF owned
references and return an error value).
caller should do its normal exception handling
(e.g.
\cfunction
{
Py
_
DECREF()
}
owned references and return an error
value).
Warning categories must be subclasses of
\cdata
{
Warning
}
; the default
warning category is
\cdata
{
RuntimeWarning
}
. The standard Python
...
...
@@ -1104,7 +1105,7 @@ Return true (nonzero) if the standard I/O file \var{fp} with name
\var
{
filename
}
is deemed interactive. This is the case for files for
which
\samp
{
isatty(fileno(
\var
{
fp
}
))
}
is true. If the global flag
\cdata
{
Py
_
InteractiveFlag
}
is true, this function also returns true if
the
\var
{
name
}
pointer is
\NULL
{}
or if the name is equal to one of
the
\var
{
file
name
}
pointer is
\NULL
{}
or if the name is equal to one of
the strings
\code
{
'<stdin>'
}
or
\code
{
'???'
}
.
\end{cfuncdesc}
...
...
@@ -1497,22 +1498,24 @@ Call a callable Python object \var{callable_object}, with
arguments given by the tuple
\var
{
args
}
. If no arguments are
needed, then
\var
{
args
}
may be
\NULL
{}
. Returns the result of the
call on success, or
\NULL
{}
on failure. This is the equivalent
of the Python expression
\samp
{
apply(
\var
{
o
}
,
\var
{
args
}
)
}
.
of the Python expression
\samp
{
apply(
\var
{
callable
_
object
}
,
\var
{
args
}
)
}
.
\bifuncindex
{
apply
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
CallFunction
}{
PyObject *callable
_
object, char *format, ...
}
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
CallFunction
}{
PyObject *callable
_
object,
char *format, ...
}
Call a callable Python object
\var
{
callable
_
object
}
, with a
variable number of C arguments. The C arguments are described
using a
\cfunction
{
Py
_
BuildValue()
}
style format string. The format may
be
\NULL
{}
, indicating that no arguments are provided. Returns the
result of the call on success, or
\NULL
{}
on failure. This is
the equivalent of the Python expression
\samp
{
apply(
\var
{
o
}
,
the equivalent of the Python expression
\samp
{
apply(
\var
{
callable
_
object
}
,
\var
{
args
}
)
}
.
\bifuncindex
{
apply
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
CallMethod
}{
PyObject *o, char *m, char *format, ...
}
\begin{cfuncdesc}
{
PyObject*
}{
PyObject
_
CallMethod
}{
PyObject *o,
char *method, char *format, ...
}
Call the method named
\var
{
m
}
of object
\var
{
o
}
with a variable number
of C arguments. The C arguments are described by a
\cfunction
{
Py
_
BuildValue()
}
format string. The format may be
\NULL
{}
,
...
...
@@ -1687,7 +1690,7 @@ expression \samp{\var{o1} >> \var{o2}}.
\begin{cfuncdesc}
{
PyObject*
}{
PyNumber
_
And
}{
PyObject *o1, PyObject *o2
}
Returns the ``bitwise and'' of
\var
{
o2
}
and
\var
{
o2
}
on success and
\NULL
{}
on failure. This is the equivalent of the Python expression
\samp
{
\var
{
o1
}
\&
\var
{
o2
}}
.
\samp
{
\var
{
o1
}
\&
\
\var
{
o2
}}
.
\end{cfuncdesc}
...
...
@@ -1745,7 +1748,7 @@ See the built-in function \function{pow()}\bifuncindex{pow}. Returns
\NULL
{}
on failure. The operation is done
\emph
{
in-place
}
when
\var
{
o1
}
supports it. This is the equivalent of the Python expression
\samp
{
\var
{
o1
}
**=
\var
{
o2
}}
when o3 is
\cdata
{
Py
_
None
}
, or an in-place variant of
\samp
{
pow(
\var
{
o1
}
,
\var
{
o2
}
, var
{
o3
}
)
}
otherwise. If
\var
{
o3
}
is to be
\samp
{
pow(
\var
{
o1
}
,
\var
{
o2
}
,
\
var
{
o3
}
)
}
otherwise. If
\var
{
o3
}
is to be
ignored, pass
\cdata
{
Py
_
None
}
in its place (passing
\NULL
{}
for
\var
{
o3
}
would cause an illegal memory access).
\end{cfuncdesc}
...
...
@@ -1767,10 +1770,10 @@ supports it. This is the equivalent of the Python expression \samp{\var{o1}
\begin{cfuncdesc}
{
PyObject*
}{
PyNumber
_
InPlaceAnd
}{
PyObject *o1, PyObject *o2
}
Returns the ``bitwise and'' of
\var
{
o
2
}
and
\var
{
o2
}
on success
and
\NULL
{}
on failure. The operation is done
\emph
{
in-place
}
when
\var
{
o1
}
supports it. This is the equivalent of the Python expression
\samp
{
\var
{
o1
}
\&
=
\var
{
o2
}}
.
Returns the ``bitwise and'' of
\var
{
o
1
}
and
\var
{
o2
}
on success
and
\NULL
{}
on failure. The operation is done
\emph
{
in-place
}
when
\var
{
o1
}
supports it. This is the equivalent of the Python expression
\
samp
{
\var
{
o1
}
\
&
=
\var
{
o2
}}
.
\end{cfuncdesc}
...
...
@@ -1883,7 +1886,7 @@ statement \samp{\var{o}[\var{i}] = \var{v}}.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PySequence
_
DelItem
}{
PyObject *o, int i
}
Delete the
\var
{
i
}
th element of object
\var
{
v
}
. Returns
Delete the
\var
{
i
}
th element of object
\var
{
o
}
. Returns
\code
{
-1
}
on failure. This is the equivalent of the Python
statement
\samp
{
del
\var
{
o
}
[
\var
{
i
}
]
}
.
\end{cfuncdesc}
...
...
@@ -2043,7 +2046,7 @@ The functions in this chapter are specific to certain Python object
types. Passing them an object of the wrong type is not a good idea;
if you receive an object from a Python program and you are not sure
that it has the right type, you must perform a type check first;
for example
.
to check that an object is a dictionary, use
for example
,
to check that an object is a dictionary, use
\cfunction
{
PyDict
_
Check()
}
. The chapter is structured like the
``family tree'' of Python object types.
...
...
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