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-115756: make PyCode_GetFirstFree an unstable API#115781

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
encukou merged 7 commits intopython:mainfromwrongnull:raname-getfirstfree
Mar 19, 2024

Conversation

wrongnull
Copy link
Contributor

@wrongnullwrongnull commentedFeb 21, 2024
edited by bedevere-appbot
Loading

According tothis , should I mention it in the documentation in a separate pull request?

@erlend-aasland
Copy link
Contributor

According tothis , should I mention it in the documentation in a separate pull request?

No; this PR represents an atomic change. Documentation (and preferably tests) follow. Your previous PR consisted oftwo different changes1.

But you cannot just remove the existing API; you need to keep it and deprecate it (seePEP-387).

Footnotes

  1. 1: fix the return type ofone API. 2: change the documentation ofanother API.

@Eclips4
Copy link
Member

Here's an example of deprecation:#105397

wrongnull reacted with thumbs up emoji

@wrongnull
Copy link
ContributorAuthor

The question may seem silly but should I add a news section?

@encukou
Copy link
Member

Yes, you should. it's a user-visible change.

@encukouencukouenabled auto-merge (squash)March 19, 2024 08:31
@@ -226,11 +226,15 @@ static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) {
return op->co_nfreevars;
}

static inline int PyCode_GetFirstFree(PyCodeObject *op) {
static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) {
assert(PyCode_Check(op));
return op->co_nlocalsplus - op->co_nfreevars;
}

Copy link
Member

@vstinnervstinnerMar 19, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If the deprecation has no detail, for me, it can be removed as soon as in Python 3.15. But the doc is more specific:

"The old name is deprecated, but will remain available until the signature changes again."

Please add a comment to explain it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If the deprecation has no detail, for me, it can be removed in Python 3.15.

What are you basing this on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

PEP 387: Similarly a feature cannot be removed without notice between any two consecutive releases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm sorry, I didn't disable automerge after your comment. I didn't mean to ignore you :(

But IMO, the “Basic Policy” is just a summary. The“Making Incompatible Changes” section has more detailed instructions.
If you disagree with my reading, let's take it to Discourse; this isn't a good place for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's just that this function has a specific comment in the doc, IMO it's worth it to repeat it in the header to avoid future eagger removal. But well, now that the change is merged, it's maybe no longer worth it.

encukou reacted with thumbs up emoji
@encukouencukou merged commita8e93d3 intopython:mainMar 19, 2024
vstinner pushed a commit to vstinner/cpython that referenced this pull requestMar 20, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull requestMar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner left review comments

@encukouencukouencukou approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aasland

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

Successfully merging this pull request may close these issues.

5 participants
@wrongnull@erlend-aasland@Eclips4@encukou@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp