
Nov. 24, 2021
2:22 p.m.
On Wed, Nov 24, 2021 at 10:59 AM Petr Viktorin <encukou@gmail.com> wrote:
Since this is about converting existing macros (and not writing new ones), can you talk about which of the "macro pitfalls" apply to the macros in CPython that were/will be changed?
The PEP 670 lists many pitfalls affecting existing macros. Some pitfalls are already worked around in the current implementations, but the point is that it's easy to miss pitfalls when reviewing code adding new macros or modifying macros. Erlend did an analysis in: https://bugs.python.org/issue43502 For macros reusing arguments (known as "Duplication of side effects" in GCC Macro Pitfalls), see his list: https://bugs.python.org/file49877/macros-that-reuse-args.txt Victor