[Python-ideas] Match statement brainstorm

Chris Angelico rosuav at gmail.com
Wed May 25 01:11:10 EDT 2016

On Wed, May 25, 2016 at 3:03 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> How about
>     for <thing>:
>         try <matcher>:
>             pass
>         try <matcher>:
>             pass
> Look Ma!  No new keywords!  Yeah, I know, "for" and "try" both have
> very strong connotations in Python already, so this may be a "not even
> the Dutch could like it" automatic-parser-only syntax.

I'd much prefer a different keyword instead of 'for'. If 'with' hadn't
been used, that would be a better choice. Maybe 'using'... or
'switch'. But without iteration, 'for' is going to be very confusing.


More information about the Python-ideas mailing list