Skip to content

gh-106320: Remove private _PyLong_New() function - #108604

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:pycore_long
Aug 29, 2023
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:pycore_long

Conversation

@vstinner

@vstinner vstinner commented Aug 29, 2023 •

Copy link
Copy Markdown
Member

Move the following private API to the internal C API (pycore_long.h):

  • _PyLong_Copy()
  • _PyLong_FromDigits()
  • _PyLong_New()

No longer export most of these functions.

Move the following private API to the internal C API (pycore_long.h):

* _PyLong_Copy()
* _PyLong_FromDigits()
* _PyLong_New()

No longer export most of these functions.
@skirpichev

Copy link
Copy Markdown
Member

@vstinner, we use _PyLong_New() in the gmpy2, e.g. in the GMPy_PyLong_From_MPZ() method. What's now the intended replacement for this private API?

@skirpichev

Copy link
Copy Markdown
Member

Another user is the sage:

$ git grep _PyLong_N
src/sage/libs/gmp/pylong.pyx:from cpython.longintrepr cimport _PyLong_New, py_long, digit, PyLong_SHIFT
src/sage/libs/gmp/pylong.pyx:    L = _PyLong_New(pylong_size)
@vstinner

vstinner commented Oct 27, 2023 •

Copy link
Copy Markdown
Member Author

we use _PyLong_New() in the gmpy2, e.g. in the GMPy_PyLong_From_MPZ() method. What's now the intended replacement for this private API?

Would you mind to open a separated issue describing how you use _PyLong_New() and which API do you need? _PyLong_New() changed a lot in Python 3.12: see also issue #111140.

@skirpichev

Copy link
Copy Markdown
Member

I've opened #111415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants