Skip to content

gh-106320: Remove private PyLong C API functions - #108429

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:internal_long
Aug 24, 2023
Merged

gh-106320: Remove private PyLong C API functions#108429
vstinner merged 1 commit into
python:mainfrom
vstinner:internal_long

Conversation

@vstinner

@vstinnervstinner commented Aug 24, 2023

Copy link
Copy Markdown
Member

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.
@vstinnervstinner changed the title 106320: Remove private PyLong C API functionsgh-106320: Remove private PyLong C API functionsAug 24, 2023
@rhettinger
rhettinger removed their request for review August 24, 2023 16:30
@vstinner

Copy link
Copy Markdown
MemberAuthor

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

@vstinner
vstinner merged commit c55e731 into python:mainAug 24, 2023
@vstinner
vstinner deleted the internal_long branch August 24, 2023 16:53
@scoder

Copy link
Copy Markdown
Contributor

What is the intended replacement for _PyLong_FromByteArray() ?

@scoder

Copy link
Copy Markdown
Contributor

What is the intended replacement for _PyLong_GCD() ?

@vstinner

vstinner commented Oct 20, 2023

Copy link
Copy Markdown
MemberAuthor

@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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@scoder@bedevere-bot