• [Python-announce] PEP 638 (syntactic macros): a runnable sandbox for exploring the proposal

    From Stanislaw Adaszewski@[email protected] to comp.lang.python.announce on Wed Oct 14 22:02:05 2026
    From Newsgroup: comp.lang.python.announce

    Hi all,
    I’ve put together a browser-based sandbox for PEP 638 (syntactic
    macros), so the proposal can be tried out and discussed against code
    that runs rather than against the text alone:
    Sandbox: https://sadaszewski.github.io/python-pep638-syntactic-macros/
    Source (CPython 3.14.2 patch, Pyodide build, notes): https://github.com/sadaszewski/python-pep638-syntactic-macros
    Two things up front. The implementation is AI-generated, and it is not
    being proposed for inclusion in CPython. Its only purpose is to make
    it possible to explore the PEP: what the three macro kinds feel like
    in practice, where the PEP leaves behaviour unspecified (the notes in
    the repo list the places I had to make a decision), and whether a
    proposal along these lines is something the Steering Council would
    ever consider.
    It implements the PEP as written: the name! token, statement and
    expression macro forms, import!/from! at compile time, the three
    processor kinds, multi-part macros, stmt_expr, and .pyc invalidation
    on macro version changes. The sandbox has seven worked examples to
    start from.
    If people find it useful for discussing the PEP, I’d be glad to hear
    where that discussion should take place.
    Best regards,
    --
    Stan Adaszewski
    --- Synchronet 3.22a-Linux NewsLink 1.2