On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote:
> On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > > I think it would be useful if iterators on sequences had the __index__
> > > method so that they could be used to slice sequences. I was writing a
> > > class and wanted to re
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote:
> On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > > I think it would be useful if iterators on sequences had the __index__
> > > method so that they could be used to slice sequences. I was writing a
> > > class and wanted to re
On Jun 25, 12:11 am, schickb <[EMAIL PROTECTED]> wrote:
>
> But this isn't just about slicing. I'd like sequence iterators to be
> usable as simple indexes as well; like a[it] (which __index__ would
> also provide).
It occurred to me that this wouldn't need to be limited to sequence
iterators. Alt
On Jun 24, 5:46 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> Wanting to slice while iterating is a *very* specialized usage.
I disagree because iterators mark positions, which for sequences are
just offsets. And slicing is all about offsets. Here is a quote from
the already implemented PEP 357:
schickb wrote:
On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
I think it would be useful if iterators on sequences had the __index__
method so that they could be used to slice sequences. I was writing a
class and wanted to return a list iterator to callers. I then wanted
to let caller
On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
> > I think it would be useful if iterators on sequences had the __index__
> > method so that they could be used to slice sequences. I was writing a
> > class and wanted to return a list iterator to callers. I then wanted
> > to let callers
On Jun 24, 3:29 pm, schickb <[EMAIL PROTECTED]> wrote:
> I think it would be useful if iterators on sequences had the __index__
> method so that they could be used to slice sequences. I was writing a
> class and wanted to return a list iterator to callers. I then wanted
> to let callers slice from
I think it would be useful if iterators on sequences had the __index__
method so that they could be used to slice sequences. I was writing a
class and wanted to return a list iterator to callers. I then wanted
to let callers slice from an iterator's position, but that isn't
supported without creat