syntax enhancement

Terry Reedy tjreedy at udel.edu
Tue Oct 4 21:45:14 EDT 2011


On 10/4/2011 9:50 AM, Valiev Sergey wrote:

> - `[]` - used for list comprehension,
> - `()` - used for generators,
> - `[start:stop]` / `[start:stop:step]` - used for slices.
> The idea is to use `(start:stop)` / `(start:stop:step)` as 'lazy
> evaluated' slices (like itertools.islice).
> What do you think about it?

a(b) is already used for function calls. Making a(b:c) be something 
unreleated does not seem like a good idea to me. At present, a[b:c] == 
a[slice(b,c)]. However, a(slice(b,c)) is already a function call and 
could not equal a(b:c).

-- 
Terry Jan Reedy




More information about the Python-list mailing list