Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-128863: deprecate _PyLong_FromDigits() function#127939

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

skirpichev
Copy link
Contributor

@skirpichevskirpichev commentedDec 14, 2024
edited
Loading

@skirpichev
Copy link
ContributorAuthor

Ok, this depend on#127925

@skirpichevskirpichev marked this pull request as draftDecember 14, 2024 07:30
@skirpichevskirpichev changed the titlegh-127937: deprecate _PyLong_FromDigits() functiongh-128863: deprecate _PyLong_FromDigits() functionJan 23, 2025
@vstinner
Copy link
Member

Ok, this depend on#127925

You can use the macros in _decimal:

    _Py_COMP_DIAG_PUSH    _Py_COMP_DIAG_IGNORE_DEPR_DECLS...    _Py_COMP_DIAG_POP

See examples in Modules/_testcapimodule.c.

@vstinner
Copy link
Member

_PyLong_Copy() emits a deprecation warning. You can rename _PyLong_FromDigits() to long_fromdigits() and use this one in _PyLong_Copy().

@skirpichev
Copy link
ContributorAuthor

_PyLong_Copy() emits a deprecation warning.

This is a draft due to#127925.

You can rename _PyLong_FromDigits() to long_fromdigits() and use this one in _PyLong_Copy().

That does make sense if no stdlib module will depend on _PyLong_FromDigits(). Unfortunately, there is no short cut for copy.copy() in C-API.

@vstinner
Copy link
Member

This is a draft due to#127925.

I'm not sure that PRgh-127925 is ever going to be merged :-(

That does make sense if no stdlib module will depend on _PyLong_FromDigits(). Unfortunately, there is no short cut for copy.copy() in C-API.

I didn't understand your comment. I'm only proposing a local "fix" for _PyLong_Copy() to avoid the deprecation warning.

@skirpichev
Copy link
ContributorAuthor

I didn't understand your comment.

Nevermind, I was thinking about_PyLong_Copy(), which is also public now.

I'm only proposing a local "fix" for _PyLong_Copy() to avoid the deprecation warning.

That seems fine. But maybe we should just inline code, it's not used anywhere else in the longobject.c.

@skirpichevskirpichev marked this pull request as ready for reviewJanuary 24, 2025 06:21
@skirpichev
Copy link
ContributorAuthor

Ok, I did this ready for review. Once#127925 will be merged - this should pass tests.

After some thinking, the_PyLong_FromDigits() code was inlined in the_PyLong_Copy(). I doubt we need for_PyLong_FromDigits() in future.

@vstinner
Copy link
Member

You should use _Py_COMP_DIAG_IGNORE_DEPR_DECLS in _decimal.c, as I wrote in my previous comment.

@skirpichev
Copy link
ContributorAuthor

You should use _Py_COMP_DIAG_IGNORE_DEPR_DECLS in _decimal.c, as I wrote in my previous comment.

No, this rather fits for testing code.

@vstinnervstinner merged commit233fd00 intopython:mainJan 24, 2025
41 checks passed
@vstinner
Copy link
Member

Merged, thanks.

@skirpichevskirpichev deleted the deprecate-_PyLong_FromDigits/127937 branchJanuary 24, 2025 12:27
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnerAwaiting requested review from vstinner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@skirpichev@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp