[Python-ideas] a in x or in y
Serhiy Storchaka
storchaka at gmail.com
Thu Feb 13 16:04:27 CET 2014
13.02.14 12:57, Steven D'Aprano написав(ла):
> I like it. In natural language, people often say things like:
>
> my keys are in the car or in my pocket
>
> which fools them into writing:
>
> keys in car or pocket
>
> which does the wrong thing. Chained "in" comparisons is a natural
> extension to Python's already natural language-like syntax. Python
> already has other chained comparisons. Being able to write:
>
> keys in car or in pocket
>
> feels natural and right to me. (We can't *quite* match the human idiom
> where the second "in" is left out, but one can't have everything.)
You forgot keyword "are".
keys are in car or in pocket
More information about the Python-ideas
mailing list