On Wed, Feb 23, 2022 at 7:11 PM Petr Viktorin <encu...@gmail.com> wrote:
> I did realize there's one more issue when converting macros or static
> inline functions to regular functions.
> Regular functions' bodies aren't guarded by limited API #ifdefs, so if
> they are part of the limited API it's easy to forget to think about it
> when changing them.
> If a macro in the limited API is converted to a regular function, then a
> test should be added to ensure the old implementation of the macro (i.e.
> what's compiled into stable ABI extensions) still works.

Does it problem really belongs to PEP 670 "Convert macros to functions
in the Python C API", or is it more something for PEP 652 "Maintaining
the Stable ABI"?

I don't think that Python 3.11 should keep a copy of Python 3.10
macros: it would increase the maintenance burden, each function would
have 2 implementations (3.11 function and 3.10 macro). Also, there
would be no warranty that the copied 3.10 macros would remain exactly
the same than 3.10 code if someone changes them by mistake directly or
indirectly (by changing code used by this macro, changing a compiler
flag, etc).

Maybe such stable ABI test belongs to an external project building a C
extension with the Python 3.10 limited C API (or an older version) and
then test it on Python 3.11. IMO it's the reliable way to test the
stable ABI: a functional test.

Victor
-- 
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/HTO2BIVD2SIJGXY3HC7OFG3YW7PXXTT6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to