[Python-ideas] Integrate some itertools into the Python syntax
Pavol Lisy
pavol.lisy at gmail.com
Wed Mar 23 01:06:58 EDT 2016
2016-03-22 20:43 GMT+01:00, Michel Desmoulin <desmoulinmichel at gmail.com>:
> No you didn't store the lines, the whole points is that they are
> returning generators.
>
> In that context, f[begin, end] does itertools.takewhile and dropwhile
> and [:10000] is doing islice(0, 10000). None of those functions store
> anything.
>
> Please read the begining of thread.
It would be true if f is generator.
If f is list then we could probably want to have another operator to
avoid memory consumption
return list(f{begin,end}{:10000})
#return list(f{begin,end}[:10000]) # this could be same
More information about the Python-ideas
mailing list