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
ff2cea22
Commit
ff2cea22
authored
Dec 02, 2007
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove PyInt API from the docs. Extend PyLong docs to cover all public functions in longobject.c.
parent
2c7c6339
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
148 deletions
+84
-148
Doc/c-api/concrete.rst
Doc/c-api/concrete.rst
+79
-143
Doc/extending/extending.rst
Doc/extending/extending.rst
+5
-5
No files found.
Doc/c-api/concrete.rst
View file @
ff2cea22
This diff is collapsed.
Click to expand it.
Doc/extending/extending.rst
View file @
ff2cea22
...
...
@@ -165,7 +165,7 @@ error on to the interpreter but wants to handle it completely by itself
Every failing :cfunc:`malloc` call must be turned into an exception --- the
direct caller of :cfunc:`malloc` (or :cfunc:`realloc`) must call
:cfunc:`PyErr_NoMemory` and return a failure indicator itself. All the
object-creating functions (for example, :cfunc:`Py
Int
_FromLong`) already do
object-creating functions (for example, :cfunc:`Py
Long
_FromLong`) already do
this, so this note is only relevant to those who call :cfunc:`malloc` directly.
Also note that, with the important exception of :cfunc:`PyArg_ParseTuple` and
...
...
@@ -889,10 +889,10 @@ reference or not.
Most functions that return a reference to an object pass on ownership with the
reference. In particular, all functions whose function it is to create a new
object, such as :cfunc:`Py
Int
_FromLong` and :cfunc:`Py_BuildValue`, pass
object, such as :cfunc:`Py
Long
_FromLong` and :cfunc:`Py_BuildValue`, pass
ownership to the receiver. Even if the object is not actually new, you still
receive ownership of a new reference to that object. For instance,
:cfunc:`Py
Int
_FromLong` maintains a cache of popular values and can return a
:cfunc:`Py
Long
_FromLong` maintains a cache of popular values and can return a
reference to a cached item.
Many functions that extract objects from other objects also transfer ownership
...
...
@@ -942,7 +942,7 @@ an unrelated object while borrowing a reference to a list item. For instance::
{
PyObject *item = PyList_GetItem(list, 0);
PyList_SetItem(list, 1, Py
Int
_FromLong(0L));
PyList_SetItem(list, 1, Py
Long
_FromLong(0L));
PyObject_Print(item, stdout, 0); /* BUG! */
}
...
...
@@ -974,7 +974,7 @@ increment the reference count. The correct version of the function reads::
PyObject *item = PyList_GetItem(list, 0);
Py_INCREF(item);
PyList_SetItem(list, 1, Py
Int
_FromLong(0L));
PyList_SetItem(list, 1, Py
Long
_FromLong(0L));
PyObject_Print(item, stdout, 0);
Py_DECREF(item);
}
...
...
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