Thoughts on new grammar rules (PEP 284 in particular)

holger krekel pyth at devel.trillke.net
Fri May 10 14:25:31 EDT 2002


Steve Holden wrote:
> I'm not sure what you think would be wrong. It's only the syntax/semantics
> of the "for" statement this PEP would change. As always, the "if" statement
> you quote will work (Python has had chained comparisons since God was a
> small girl):
> 
> >>> for x in range(-10, 20):   # [-10, -9, ... , 19]
> ...     if 0 <= x < 10:
> ...         print x, "is in range"
> ...
> 0 is in range
> 1 is in range
> 2 is in range
> 3 is in range
> 4 is in range
> 5 is in range
> 6 is in range
> 7 is in range
> 8 is in range
> 9 is in range
> >>>

david and you are right but additionally the OP suggested
a general [* syntax *] escape mechanism. 

   holger





More information about the Python-list mailing list