list (range) syntax

Christof Winter winter at
Fri Oct 26 15:14:38 CEST 2007

Ryan Ginstrom wrote:
>> On Behalf Of Steven D'Aprano
>> Because in common English, counting starts at 1 and ranges 
>> normally include both end points (that is, it is a "closed" 
>> interval). If you say "I'll be away from the 4th to the 7th" 
>> and then turn up on the 7th, nearly everyone will wonder why 
>> you're back a day early.
> Actually, I think this illustrates the point about confusion, because in the
> United States at least, "the 4th to the 7th" will not necessarily include
> the 7th. That's why it's common to use circumlocutions like "the 4th through
> the 7th" and "the 4th to the 7th, inclusive" when one wants to be sure.

[slightly OT]
A better example would be "10 to 12 people", which translates to "10, 11, or 12 
people" and hardly ever "10 or 11 people".

More information about the Python-list mailing list