Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
cf33af7
356db2f
001fe51
db8cb38
012f351
1a45b38
04c101d
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -226,11 +226,15 @@ static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) { | ||
return op->co_nfreevars; | ||
} | ||
static inline intPyUnstable_Code_GetFirstFree(PyCodeObject *op) { | ||
assert(PyCode_Check(op)); | ||
return op->co_nlocalsplus - op->co_nfreevars; | ||
} | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more.
What are you basing this on? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
Py_DEPRECATED(3.13) static inline int PyCode_GetFirstFree(PyCodeObject *op) { | ||
return PyUnstable_Code_GetFirstFree(op); | ||
} | ||
#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive) | ||
#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT)) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:c:func:`!PyCode_GetFirstFree` is an ustable API now and has been renamed to | ||
:c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan Romanyuk in | ||
:gh:`115781`) |