[Python-ideas] Fwd: quantifications, and tuple patterns

Devin Jeanpierre jeanpierreda at gmail.com
Mon Jan 16 00:29:39 CET 2012


On Sun, Jan 15, 2012 at 12:01 PM, Annie Liu <liu at cs.stonybrook.edu> wrote:
> For separator, I had used "if" (not "has") because it is consistent
> with uses of conditions in general in Python, and with uses of "|" in
> SETL.  SETL has:
>
>   comprehension        {ret_exp: x in s | pred}
>   quantification       exists x in s | pred
>                        forall x in s | pred
>   for loop             for x in s | pred loop ... end loop
>
>   and you get "while exists x in s | pred" for free.

I hadn't been _really_ paying attention, [no active reading] but the
"if" had confused me until I read this -- I didn't know what it meant.
I'm so much more used to "|" and "s.t. (such that)". If reads like
implication, which is something else.

Of course, the same complaint applies to list comprehensions, so I
expect I'll get used to it, but... with list comprehensions it seemed
obvious because it replaced an idiom that literally used the if
statement. Is the same true here?

-- Devin



More information about the Python-ideas mailing list