On Wed, Jul 13, 2011 at 10:29 AM, Terry Reedy <tjre...@udel.edu> wrote: > The iteration protocol and the notion of iteraables as the common data > exchange format, with associated notions of iterators, generator functions, > and generators, are important features of Python. Not really functional > style, I guess.
Xah Lee's assertion to the contrary notwithstanding, it seems to me that list comprehensions are basically functional in style. They are, after all, equivalent to "map(f, filter(g, x))". Iterators, on the other hand, by definition have the property that each call to iter.next() has the side effect of changing the iterator's state. Therefore, although they can effectively be used as a functional building block (e.g. by masking their use with a comprehension), the iterators themselves are not actually functional. -- http://mail.python.org/mailman/listinfo/python-list