On Wed, 05 Oct 2011 13:31:41 -0500, Tim Chase wrote:
> I'm very -1 on the initial proposal with parens, but I wouldn't object
> to generators growing a method (__getitem__?) to do slices via
> itertools, something like
>
>gen = (a for a in iterator if test(a))
>for thing in gen[4::2]:
>
On Wed, Oct 5, 2011 at 3:28 PM, Westley Martínez wrote:
> Wait, how would this work fundamentally? A list can be sliced because
> all the values are there. A generator does not have all its value at
> once (it generates each value as requested). I don't like change so I
> look at these kinds of
On Wed, Oct 05, 2011 at 01:31:41PM -0500, Tim Chase wrote:
> On 10/04/11 20:45, Terry Reedy wrote:
> >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
On 10/5/2011 2:31 PM, Tim Chase wrote:
On 10/04/11 20:45, Terry Reedy wrote:
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
On 10/04/11 20:45, Terry Reedy wrote:
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
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 a
On Tue, Oct 4, 2011 at 9:50 AM, Valiev Sergey wrote:
> Hi,
> you may found this idea stupid, but nevertheless...
> - `[]` - used for list comprehension,
> - `()` - used for generators,
> - `[start:stop]` / `[start:stop:step]` - used for slices.
> The idea is to use `(start:stop)` / `(start:stop:s
Hi,
you may found this idea stupid, but nevertheless...
- `[]` - 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 y