This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Dennis Sweeney, Guido.van.Rossum, Mark.Shannon, Yonatan Goldschmidt, ammar2, chris.jerdonek, corona10, erlendaasland, gvanrossum, hauntsaninja, pablogsal, petr.viktorin, rhettinger, serhiy.storchaka
Date 2021-05-11.09:13:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620724438.6.0.333335837598.issue40222@roundup.psfhosted.org>
In-reply-to
Content
I know PyCode_NewWithPosOnlyArgs is declared as "PyAPI_FUNC" but that can't make it part of the ABI unless it has stable behavior.
It can't have stable behavior because its inputs are complex, undefined, have altered semantics and are interlinked in complex ways.

Passing the same arguments to PyCode_NewWithPosOnlyArgs for both 3.9 and 3.10 will cause one or other version to crash (interpreter crash, not just program crash).


We need to stop adding "PyAPI_FUNC" to everything.
Adding a PyAPI_FUNC does not magically make for ABI compatibility, there is a lot more to it than that.

The only sane ways to construct a code object are to load it from disk, to compile an AST, or to use
codeobject.replace(). Any purported ABI compatibility claims are just misleading and a trap.


I can revert the API changes and add a new function, but I think that is dangerously misleading. A compilation error is preferable to an interpreter crash.
History
Date User Action Args
2021-05-11 09:13:58Mark.Shannonsetrecipients: + Mark.Shannon, gvanrossum, rhettinger, petr.viktorin, chris.jerdonek, serhiy.storchaka, Guido.van.Rossum, ammar2, corona10, pablogsal, Dennis Sweeney, erlendaasland, Yonatan Goldschmidt, hauntsaninja
2021-05-11 09:13:58Mark.Shannonsetmessageid: <1620724438.6.0.333335837598.issue40222@roundup.psfhosted.org>
2021-05-11 09:13:58Mark.Shannonlinkissue40222 messages
2021-05-11 09:13:58Mark.Shannoncreate