[0..9] list (range) syntax

Wildemar Wildenburger lasses_weil at klapptsowieso.net
Thu Oct 25 11:31:15 EDT 2007


Michal Bozon wrote:
> The .. syntax was not meant only as something
> which would include the last item,
> but also/rather a range list syntactic shortcut:
> 
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -->
> [0, 1, ... 9, 10] -->
> [0..10]
> 
OK, I see.

But I still fail to see where this is useful. All these 3 statements 
create a list from 0 to 10 including.

If, however, the ".." operator would recognize patterns before and after 
itself, I could see your point (e.g. [0, 1, 2, 4, 8, .. 128, 256, 512]). 
Buts thats pretty academic, maybe good for a specialized computation 
language.

And I feel that my "write a function" argument still holds.

/W



More information about the Python-list mailing list