Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Preserve deprecated API function
  • Loading branch information
wrongnull committed Feb 22, 2024
commit 356db2f2a37fe781ba3319d0cb88abc49d3d4977
4 changes: 4 additions & 0 deletions Include/cpython/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ static inline int PyUnstable_Code_GetFirstFree(PyCodeObject *op) {
return op->co_nlocalsplus - op->co_nfreevars;
}

Copy link
Copy Markdown
Member

@vstinner vstinner Mar 19, 2024

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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

Expand Down