[Python-ideas] [Python-Dev] Inclusive Range
bborcic at gmail.com
Tue Oct 5 13:45:56 CEST 2010
Nick Coghlan wrote:
> [...] Being able to say things like
> "10:00"<= x< '12:00", 10.0<= x< 12.0, "a"<= x< "n" are much
> clearer than trying to specify their closed range equivalents.
makes one wonder about syntax like :
for 10 <= x < 20 :
Mh, I suppose with rich comparisons special methods, it's possible to turn
chained comparisons into range factories without introducing new syntax.
Something more like
for x in (10 <= step(1) < 20) :
More information about the Python-ideas