[Python-ideas] Match statement brainstorm

Nikolaus Rath Nikolaus at rath.org
Wed May 25 16:48:44 EDT 2016


On May 25 2016, "Stephen J. Turnbull" <stephen-Sn97VrDLz2sdnm+yROfE0A at public.gmane.org> wrote:
> How about
>
>     for <thing>:
>         try <matcher>:
>             pass
>         try <matcher>:
>             pass

Or maybe:

if <thing> ...
   matches <matcher>:
      pass
   matches <matcher>:
      pass

Where "..." is an actual syntactic element that replaces the ":" in a
regular if.


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-ideas mailing list