mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
gh-108444: Add PyLong_AsInt() public function (#108445)
* Rename _PyLong_AsInt() to PyLong_AsInt(). * Add documentation. * Add test. * For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
This commit is contained in:
parent
feb9a49c9c
commit
be436e08b8
13 changed files with 96 additions and 3 deletions
|
|
@ -2,7 +2,8 @@
|
|||
# error "this header file must not be included directly"
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
|
||||
// Alias for backport compatibility
|
||||
#define _PyLong_AsInt PyLong_AsInt
|
||||
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
|
||||
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
|
||||
|
|
|
|||
|
|
@ -18,12 +18,18 @@ PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
|
|||
PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t);
|
||||
PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t);
|
||||
PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
|
||||
|
||||
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
|
||||
PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *);
|
||||
PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
|
||||
PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
|
||||
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
|
||||
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
|
||||
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
|
||||
PyAPI_FUNC(int) PyLong_AsInt(PyObject *);
|
||||
#endif
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
|
||||
|
||||
/* It may be useful in the future. I've added it in the PyInt -> PyLong
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue