Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 29, 2023

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.
@vstinner vstinner merged commit 921eb8e into python:main Aug 29, 2023
17 checks passed
@vstinner vstinner deleted the pycore_long branch August 29, 2023 02:59
@skirpichev
Copy link
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
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
Copy link
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 log in Python 3.12: see also issue #111140.

@skirpichev
Copy link
Member

I've opened #111415

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

Successfully merging this pull request may close these issues.

3 participants