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
b71e9350
Commit
b71e9350
authored
Nov 26, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for the PyCell* APIs.
parent
eb3b2ae9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
Doc/api/concrete.tex
Doc/api/concrete.tex
+50
-0
Doc/api/refcounts.dat
Doc/api/refcounts.dat
+17
-0
No files found.
Doc/api/concrete.tex
View file @
b71e9350
...
...
@@ -2340,3 +2340,53 @@ information on using these objects.
Returns the description
\ctype
{
void *
}
that the
\ctype
{
PyCObject
}
\var
{
self
}
was created with.
\end{cfuncdesc}
\subsection
{
Cell Objects
\label
{
cell-objects
}}
``Cell'' objects are used to implement variables referenced by
multiple scopes. For each such variable, a cell object is created to
store the value; the local variables of each stack frame that
references the value contains a reference to the cells from outer
scopes which also use that variable. When the value is accessed, the
value contained in the cell is used instead of the cell object
itself. This de-referencing of the cell object requires support from
the generated byte-code; these are not automatically de-referenced
when accessed. Cell objects are not likely to be useful elsewhere.
\begin{cvardesc}
{
PyTypeObject
}{
PyCell
_
Type
}
The type object corresponding to cell objects
\end{cvardesc}
\begin{cfuncdesc}
{
int
}{
PyCell
_
Check
}{
ob
}
Return true if
\var
{
ob
}
is a cell object;
\var
{
ob
}
must not be
\NULL
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyCell
_
New
}{
PyObject *ob
}
Create and return a new cell object containing the value
\var
{
ob
}
.
The parameter may be
\NULL
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyCell
_
Get
}{
PyObject *cell
}
Return the contents of the cell
\var
{
cell
}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyCell
_
GET
}{
PyObject *cell
}
Return the contents of the cell
\var
{
cell
}
, but without checking
that
\var
{
cell
}
is non-
\NULL
{}
and a call object.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyCell
_
Set
}{
PyObject *cell, PyObject *value
}
Set the contents of the cell object
\var
{
cell
}
to
\var
{
value
}
. This
releases the reference to any current content of the cell.
\var
{
value
}
may be
\NULL
.
\var
{
cell
}
must be non-
\NULL
; if it is
not a cell object,
\code
{
-1
}
will be returned. On success,
\code
{
0
}
will be returned.
\end{cfuncdesc}
\begin{cfuncdesc}
{
void
}{
PyCell
_
SET
}{
PyObject *cell, PyObject *value
}
Sets the value of the cell object
\var
{
cell
}
to
\var
{
value
}
. No
reference counts are adjusted, and no checks are made for safety;
\var
{
cell
}
must be non-
\NULL
{}
and must be a cell object.
\end{cfuncdesc}
Doc/api/refcounts.dat
View file @
b71e9350
...
...
@@ -67,6 +67,23 @@ PyCObject_FromVoidPtrAndDesc:void(*)(void*,void*):destr::
PyCObject_GetDesc:void*:::
PyCObject_GetDesc:PyObject*:self:0:
PyCell_New:PyObject*::+1:
PyCell_New:PyObject*:ob:0:
PyCell_GET:PyObject*::0:
PyCell_GET:PyObject*:ob:0:
PyCell_Get:PyObject*::+1:
PyCell_Get:PyObject*:cell:0:
PyCell_SET:void:::
PyCell_SET:PyObject*:cell:0:
PyCell_SET:PyObject*:value:0:
PyCell_Set:int:::
PyCell_Set:PyObject*:cell:0:
PyCell_Set:PyObject*:value:0:
PyCallIter_New:PyObject*::+1:
PyCallIter_New:PyObject*:callable::
PyCallIter_New:PyObject*:sentinel::
...
...
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