[BangPypers] if not with comparision statement in python
Dhananjay Nene
dhananjay.nene at gmail.com
Mon Aug 1 16:21:33 CEST 2011
On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai
<abpillai at gmail.com> wrote:
> IMHO, map/filter/reduce and the inevitable companion lambda were
> added on to Python when it was still trying to find its identity on where
> it stood in the pantheon of dynamic typed languages - since it wanted
> to be everything for everyone it borrowed some of these constructs
> from Lisp or other functional languages.
>
> With addition of list comps, generators etc, these right now stand
> out like sore thumbs in the language and should be got ridden
> of at the earliest.
I am certain there are contrary opinions, even though the BDFL has
weighed in. So yes, python is unlikely to be the playground for these
constructs. I find a degree of elegance and utility to these
constructs, though it is as well likely that these may seem like sore
thumbs to others.
> Also, using any of the m/f/r trio with lambda is a performance killer.
> See an earlier post in a different thread for more on this.
Its a performance killer only for cPython - its a function of runtime
not the construct. cPython is likely to stay a poorly performing
runtime for these. I do hope PyPy will fare much better - but that
remains to be seen. These constructs also help parallelisation (but
only when combined with immutability), and thats a feature python is
likely to be therefore unable to implement as far as I can imagine. Is
this a big deal - frankly no, since the sweet spot of python is pretty
broad.
More information about the BangPypers
mailing list