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
1e71b042
Commit
1e71b042
authored
Feb 10, 2003
by
Michael W. Hudson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update advice about __module__ and __name__ and tp_name wrt. new types.
Add \refs to GC section that were XXXed out.
parent
bbe17f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
Doc/api/newtypes.tex
Doc/api/newtypes.tex
+18
-14
No files found.
Doc/api/newtypes.tex
View file @
1e71b042
...
@@ -424,17 +424,20 @@ Foo_Type.ob_type = &PyType_Type;
...
@@ -424,17 +424,20 @@ Foo_Type.ob_type = &PyType_Type;
in module
\module
{
M
}
in subpackage
\module
{
Q
}
in package
\module
{
P
}
in module
\module
{
M
}
in subpackage
\module
{
Q
}
in package
\module
{
P
}
should have the
\member
{
tp
_
name
}
initializer
\code
{
"P.Q.M.T"
}
.
should have the
\member
{
tp
_
name
}
initializer
\code
{
"P.Q.M.T"
}
.
For dynamically allocated type objects, this may be just the type
For dynamically allocated type objects, this should just be the type
name, if the module name is explicitly stored in the type dict as
name, and the module name explicitly stored in the type dict as the
the value for key
\code
{
'
__
module
__
'
}
.
value for key
\code
{
'
__
module
__
'
}
.
If the tp
_
name field contains a dot, everything before the last dot
For statically allocated type objects, the tp
_
name field should
is made accessible as the
\member
{__
module
__}
attribute, and
contain a dot. Everything before the last dot is made accessible as
everything after the last dot is made accessible as the
the
\member
{__
module
__}
attribute, and everything after the last dot
\member
{__
name
__}
attribute. If no dot is present, the entire
is made accessible as the
\member
{__
name
__}
attribute.
\member
{
tp
_
name
}
field is made accessible as the
\member
{__
name
__}
attribute, and the
\member
{__
module
__}
attribute is undefined
If no dot is present, the entire
\member
{
tp
_
name
}
field is made
(unless explicitly set in the dictionary, as explained above).
accessible as the
\member
{__
name
__}
attribute, and the
\member
{__
module
__}
attribute is undefined (unless explicitly set in
the dictionary, as explained above). This means your type will be
impossible to pickle.
This field is not inherited by subtypes.
This field is not inherited by subtypes.
\end{cmemberdesc}
\end{cmemberdesc}
...
@@ -882,8 +885,8 @@ The following three fields only exist if the
...
@@ -882,8 +885,8 @@ The following three fields only exist if the
\begin{cmemberdesc}
{
PyTypeObject
}{
traverseproc
}{
tp
_
traverse
}
\begin{cmemberdesc}
{
PyTypeObject
}{
traverseproc
}{
tp
_
traverse
}
An optional pointer to a traversal function for the garbage
An optional pointer to a traversal function for the garbage
collector. This is only used if the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
collector. This is only used if the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit is set. More information in section
XXX about garbage
flag bit is set. More information in section
collection.
\ref
{
supporting-cycle-detection
}
about garbage
collection.
This field is inherited by subtypes together with
\member
{
tp
_
clear
}
This field is inherited by subtypes together with
\member
{
tp
_
clear
}
and the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit: the flag bit,
and the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit: the flag bit,
...
@@ -895,7 +898,8 @@ The following three fields only exist if the
...
@@ -895,7 +898,8 @@ The following three fields only exist if the
\begin{cmemberdesc}
{
PyTypeObject
}{
inquiry
}{
tp
_
clear
}
\begin{cmemberdesc}
{
PyTypeObject
}{
inquiry
}{
tp
_
clear
}
An optional pointer to a clear function for the garbage collector.
An optional pointer to a clear function for the garbage collector.
This is only used if the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit is
This is only used if the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit is
set. More information in section XXX about garbage collection.
set. More information in section
\ref
{
supporting-cycle-detection
}
about garbage collection.
This field is inherited by subtypes together with
\member
{
tp
_
clear
}
This field is inherited by subtypes together with
\member
{
tp
_
clear
}
and the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit: the flag bit,
and the
\constant
{
Py
_
TPFLAGS
_
HAVE
_
GC
}
flag bit: the flag bit,
...
...
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