Thoughts on new grammar rules (PEP 284 in particular)

Erik Max Francis max at alcyone.com
Fri May 10 14:41:08 EDT 2002


Steve Horne wrote:

>   if 0 <= x < 10 :
>     print "x is in range"
> 
> There is a big problem with this, of course - this is already legal
> Python, but the semantics aren't what I intend.

This should behave the way you expect.  The conditional would be
executed if 0 <= x and x < 10.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Who'd ever think it / Such a squalid little ending
\__/ The American and Florence, _Chess_
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.



More information about the Python-list mailing list