Revisiting PEP 505 – None-aware operators

My apologies! This is new info for me. (Apparently I never encountered this in TS or at least never thought about it. Or I just forgot this aspect since I last studied PEP 505?)

Fortunately Marc Mueller’s PEP describes this correctly – maybe not in the abstract (which only shows a?.b), but definitely in the spec: PEP 999 – None-aware access operators | peps.python.org

If that’s the short-circuiting that was being discussed, I take back what I said about short-circuiting.

This is in fact an important issue and will probably complicate the grammar for primary in 10. Full Grammar specification — Python 3.14.2 documentation, since currently primary is left-recursive, parsing a.b.c as (a.b).c. Maybe we’ll have to use a star operator. I think Marc Mueller’s PEP doesn’t get this right yet – the grammar there (PEP 999 – None-aware access operators | peps.python.org) still looks left-recursive.

1 Like