diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-11 19:26:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-11 19:26:36 (GMT) |
commit | c4f3212abc7e927f9218a7c82fae9e5639e272bc (patch) | |
tree | 18d65bdc892a0593c32c4ea037a992f82abfe6f0 /Include/longobject.h | |
parent | b282b3d804165d704130fabf0f609d5dd46c1ed2 (diff) | |
parent | 31a655411a79b00517cdcd0a2752824d183db792 (diff) | |
download | cpython-c4f3212abc7e927f9218a7c82fae9e5639e272bc.zip cpython-c4f3212abc7e927f9218a7c82fae9e5639e272bc.tar.gz cpython-c4f3212abc7e927f9218a7c82fae9e5639e272bc.tar.bz2 |
Issue #17576: Deprecation warning emitted now when __int__() or __index__()
return not int instance. Introduced _PyLong_FromNbInt() and refactored
PyLong_As*() functions.
Diffstat (limited to 'Include/longobject.h')
-rw-r--r-- | Include/longobject.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/longobject.h b/Include/longobject.h index 7c3f6d0..ff43309 100644 --- a/Include/longobject.h +++ b/Include/longobject.h @@ -165,6 +165,12 @@ PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, unsigned char* bytes, size_t n, int little_endian, int is_signed); +/* _PyLong_FromNbInt: Convert the given object to a PyLongObject + using the nb_int slot, if available. Raise TypeError if either the + nb_int slot is not available or the result of the call to nb_int + returns something not of type int. +*/ +PyAPI_FUNC(PyLongObject *)_PyLong_FromNbInt(PyObject *); /* _PyLong_Format: Convert the long to a string object with given base, appending a base prefix of 0[box] if base is 2, 8 or 16. */ |