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
ed227f05
Commit
ed227f05
authored
Sep 06, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly document PyNumber_Coerce.
parent
cac6c721
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Include/abstract.h
Include/abstract.h
+14
-6
No files found.
Include/abstract.h
View file @
ed227f05
...
...
@@ -580,12 +580,20 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* Implemented elsewhere:
int PyNumber_Coerce(PyObject *o1, PyObject *o2);
On success, returns a tuple containing o1 and o2 converted to
a common numeric type, or None if no conversion is possible.
Returns -1 on failure. This is equivalent to the Python
expression: coerce(o1,o2).
int PyNumber_Coerce(PyObject **p1, PyObject **p2);
This function takes the addresses of two variables of type
PyObject*.
If the objects pointed to by *p1 and *p2 have the same type,
increment their reference count and return 0 (success).
If the objects can be converted to a common numeric type,
replace *p1 and *p2 by their converted value (with 'new'
reference counts), and return 0.
If no conversion is possible, or if some other error occurs,
return -1 (failure) and don't increment the reference counts.
The call PyNumber_Coerce(&o1, &o2) is equivalent to the Python
statement o1, o2 = coerce(o1, o2).
*/
...
...
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