Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9414

Re: Functional style programming in python: what will you talk about if you have an hour on this topic?

References <2b28da74-f054-4f46-8971-43603ab7cfd3@glegroupsg2000goo.googlegroups.com> <ivkh5u$eo$1@dough.gmane.org>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-07-13 11:09 -0600
Subject Re: Functional style programming in python: what will you talk about if you have an hour on this topic?
Newsgroups comp.lang.python
Message-ID <mailman.998.1310576988.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jul 13, 2011 at 10:29 AM, Terry Reedy <tjreedy@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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Functional style programming in python: what will you talk about if you have an hour on this topic? Anthony Kong <anthony.hw.kong@gmail.com> - 2011-07-13 05:39 -0700
  Re: Functional style programming in python: what will you talk about if you have an hour on this topic? gene heskett <gheskett@wdtv.com> - 2011-07-13 09:41 -0400
  Re: Functional style programming in python: what will you talk about if you have an hour on this topic? J Kenneth King <james@agentultra.com> - 2011-07-13 09:50 -0400
  Re: Functional style programming in python: what will you talk about if you have an hour on this topic? Terry Reedy <tjreedy@udel.edu> - 2011-07-13 12:29 -0400
  Re: Functional style programming in python: what will you talk about if you have an hour on this topic? Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-13 11:09 -0600
  Re: Functional style programming in python: what will you talk about if   you have an hour on this topic? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-14 15:32 +1200
    Re: Functional style programming in python: what will you talk about if   you have an hour on this topic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-14 14:05 +1000
    Re: Functional style programming in python: what will you talk about if you have an hour on this topic? Jonathan Hartley <tartley@tartley.com> - 2011-07-14 03:33 -0700
  Re: Functional style programming in python: what will you talk about if you have an hour on this topic? Jonathan Hartley <tartley@tartley.com> - 2011-07-14 03:31 -0700

csiph-web