Guido van Rossum wrote:
> Do we really need another way to spell a <= x < b?

FWIW, I'd say yes; I sometimes find it a bit difficult to remember
how the operator should be placed, there are several possible ways
of making a mistake, eg;

   a > x < b
   a < x > b
   a < x < b
   a > x > b

Now, the range syntax seems a bit strange at first, but I find it easier 
to parse:

   if x in range(a, b)

There's no way to incorrectly parse that, it's immediately known that 
the programmer tries to see whether x is in a specific range.

It seems to be used quite widely already;

http://google.com/codesearch?hl=en&q=+%5E.*if%5Cs%2B.*%5Cs%2Bin%5Cs%2Brange%5C(.*%24&start=10&sa=N

Johan

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to