I wanted to overload Python syntax to somehow match the syntax of probabilistic expressions like E[X,Y|Z,W].

I first considered overloading | but this would be legal and have the same AST: E[X,(Y|Z),W].

However E[X,Y : Z,W], for all of its weirdness, is pretty robust even if the AST doesn't reflect the correct parsing.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mathstodon.xyz/users/dpiponi/statuses/115670713437994627 on your instance and quote it. (Note that quoting is not supported in Mastodon.)