mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)
Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
This commit is contained in:
parent
d90a141bb9
commit
6a44f6eef3
18 changed files with 326 additions and 55 deletions
|
@ -650,7 +650,9 @@ converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize)
|
|||
#define CONV_UNICODE "(unicode conversion error)"
|
||||
|
||||
/* Explicitly check for float arguments when integers are expected.
|
||||
Return 1 for error, 0 if ok. */
|
||||
Return 1 for error, 0 if ok.
|
||||
XXX Should be removed after the end of the deprecation period in
|
||||
_PyLong_FromNbIndexOrNbInt. */
|
||||
static int
|
||||
float_argument_error(PyObject *arg)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue