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
d3e02653
Commit
d3e02653
authored
Sep 10, 2002
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document type and semantics of the tp_print return value. Closes SF 606464.
parent
47ec1419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
Doc/api/newtypes.tex
Doc/api/newtypes.tex
+3
-1
No files found.
Doc/api/newtypes.tex
View file @
d3e02653
...
...
@@ -526,7 +526,7 @@ Foo_Type.ob_type = &PyType_Type;
different output than
\member
{
tp
_
repr
}
or
\member
{
tp
_
str
}
would.
The print function is called with the same signature as
\cfunction
{
PyObject
_
Print()
}
:
\code
{
tp
_
print(PyObject *self, FILE
\cfunction
{
PyObject
_
Print()
}
:
\code
{
int
tp
_
print(PyObject *self, FILE
*file, int flags)
}
. The
\var
{
self
}
argument is the instance to be
printed. The
\var
{
file
}
argument is the stdio file to which it is
to be printed. The
\var
{
flags
}
argument is composed of flag bits.
...
...
@@ -535,6 +535,8 @@ Foo_Type.ob_type = &PyType_Type;
should be printed the same way as
\member
{
tp
_
str
}
would format it;
when the
\constant
{
Py
_
PRINT
_
RAW
}
flag bit is clear, the instance
should be printed the same was as
\member
{
tp
_
repr
}
would format it.
It should return
\code
{
-1
}
and set an exception condition when an
error occurred during the comparison.
It is possible that the
\member
{
tp
_
print
}
field will be deprecated.
In any case, it is recommended not to define
\member
{
tp
_
print
}
, but
...
...
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