mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Get rid of most of the rest of coerce (slot is still there for now).
This commit is contained in:
parent
79212998a8
commit
4886cc331f
19 changed files with 131 additions and 497 deletions
|
@ -694,24 +694,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
|
|||
expression: o1|o2.
|
||||
*/
|
||||
|
||||
/* Implemented elsewhere:
|
||||
|
||||
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).
|
||||
*/
|
||||
|
||||
PyAPI_FUNC(Py_ssize_t) PyNumber_Index(PyObject *);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue