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 C API functions #108429

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 24, 2023

Remove private PyLong C API functions:

  • _PyLong_AsByteArray()
  • _PyLong_DivmodNear()
  • _PyLong_Format()
  • _PyLong_Frexp()
  • _PyLong_FromByteArray()
  • _PyLong_FromBytes()
  • _PyLong_GCD()
  • _PyLong_Lshift()
  • _PyLong_Rshift()

Move these functions to the internal C API. No longer export _PyLong_FromBytes() function.

Remove private PyLong C API functions:

* _PyLong_AsByteArray()
* _PyLong_DivmodNear()
* _PyLong_Format()
* _PyLong_Frexp()
* _PyLong_FromByteArray()
* _PyLong_FromBytes()
* _PyLong_GCD()
* _PyLong_Lshift()
* _PyLong_Rshift()

Move these functions to the internal C API. No longer export
_PyLong_FromBytes() function.
@vstinner vstinner changed the title 106320: Remove private PyLong C API functions gh-106320: Remove private PyLong C API functions Aug 24, 2023
@rhettinger rhettinger removed their request for review August 24, 2023 16:30
@vstinner
Copy link
Member Author

@erlend-aasland: sqlite3 uses another private function, _PyLong_AsByteArray().

@vstinner vstinner merged commit c55e731 into python:main Aug 24, 2023
22 checks passed
@vstinner vstinner deleted the internal_long branch August 24, 2023 16:53
@scoder
Copy link
Contributor

scoder commented Oct 20, 2023

What is the intended replacement for _PyLong_FromByteArray() ?

@scoder
Copy link
Contributor

scoder commented Oct 20, 2023

What is the intended replacement for _PyLong_GCD() ?

@vstinner
Copy link
Member Author

vstinner commented Oct 20, 2023

@scoder:

What is the intended replacement for _PyLong_FromByteArray() ?

I created PR #111140: C API: Consider adding public PyLong_AsByteArray() and PyLong_FromByteArray() functions.

What is the intended replacement for _PyLong_GCD() ?

I created PR #111139: C API: Consider adding a public PyLong_GCD() function.

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