[Python-ideas] Integrate some itertools into the Python syntax

Michel Desmoulin desmoulinmichel at gmail.com
Tue Mar 22 15:58:16 EDT 2016



Le 22/03/2016 20:52, Koos Zevenhoven a écrit :
> If your point is that generators can sometimes be hard, then your
> point is clear :-). 

Maybe using them should not be made to look more
> straightforward than it actually is.

I would have made the same mistake with itertools, let be frank.

 Which brings me back to...
> 
> One thought that comes to mind is to add some stuff from itertools as
> attributes of iter. For example: iter.slice(...). Kind of like a
> factory method, although iter is not really a type.

It's an interesting though.

Actually we could also make something like iter.wraps(iterable) to
return and object with the properties discussed in that thread. It would
be fully backward compatible, explicit, yet convenient enough.


> 
>  - Koos
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 


More information about the Python-ideas mailing list