GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106320: Remove private _PyLong_New() function by vstinner · Pull Request #108604 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Aug 29, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: C API: Remove private C API functions (move them to the internal C API) #106320

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-106320: Remove private _PyLong_New() function
001cf8c
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 added the skip news label Aug 29, 2023
@bedevere-bot bedevere-bot mentioned this pull request Aug 29, 2023
C API: Remove private C API functions (move them to the internal C API) #106320
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Aug 29, 2023
@vstinner
vstinner merged commit 921eb8e into python:main Aug 29, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Aug 29, 2023
@vstinner
vstinner deleted the pycore_long branch August 29, 2023 02:59
@skirpichev

skirpichev commented Oct 23, 2023

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev skirpichev mentioned this pull request Oct 23, 2023
gh-106320: Move private _PyHash API to the internal C API #107026
Merged
@skirpichev

skirpichev commented Oct 25, 2023

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)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 27, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Oct 27, 2023
C API: Consider adding public PyLong_AsByteArray() and PyLong_FromByteArray() functions #111140
Closed
@skirpichev skirpichev mentioned this pull request Oct 28, 2023
Consider restoring _PyLong_New() function as public #111415
Closed
@skirpichev

skirpichev commented Oct 28, 2023

Copy link
Copy Markdown
Member

I've opened #111415

vstinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

skirpichev added a commit to skirpichev/cpython that referenced this pull request Oct 28, 2023
@skirpichev
pythongh-111415: restoring _PyLong_New() as public
cc5240c
This partially reverts python#108604.
@vstinner vstinner mentioned this pull request Oct 30, 2023
[C API] Meta issue: add new public functions with doc+tests to replace removed private functions #111481
Closed
@vstinner vstinner mentioned this pull request Jul 14, 2024
PEP 757: Add import-export API for Python int objects capi-workgroup/decisions#35
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @skirpichev @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.