Fate of itertools.dropwhile() and itertools.takewhile()

Istvan Albert istvan.albert at gmail.com
Sat Dec 29 19:37:01 EST 2007


On Dec 29, 6:10 pm, Raymond Hettinger <pyt... at rcn.com> wrote:

> These thoughts reflect my own experience with the itertools module.
> It may be that your experience with them has been different.  Please
> let me know what you think.

first off, the itertools module is amazing, thanks for creating it. It
changed the way I think about programming. In fact nowadays I start
all my programs with:

from itertools import *

which may not be the best form, but I got tired of importing every
single function individually or writing out the module name.

Now I never needed the dropwhile() and takewhile() functions, but that
may not mean much. For quite a while I never needed the repeat()
function either. It even looked nonsensical to have an iterator that
simply repeats the same thing over and over. One day I had to solve a
problem that needed repeat() and made me really understand what it was
for and got to marvel at a just how neat the solution was.

i.



More information about the Python-list mailing list