if does not evaluate

Jacek Generowicz jacek.generowicz at cern.ch
Wed Jun 9 03:48:42 EDT 2004


Skip Montanaro <skip at pobox.com> writes:

> Right.  Like Terry said, for anything more substantial use a named function.
> Lambda was never intended to be a replacement for def, and Python is
> fundamentally not a functional language (in the Haskell/Lisp sense of the
> term), so powerful anonymous functions are generally not needed.

I wish people would stop making such self-fulfilling prophecies.

You[*] don't use fully general anonymous closures, because the
languages you use do not provide you that tool. Because such beasts,
do not form part of your normal programming arsenal, you don't use
them. Because you don't use them, you rarely see them used. Because
you rarely see them used, you conclude that they are not needed. You
you make the mistake of confusing your lack of imagination with some
inherent quality of the language in question. The fact is that people
who are used to using powerful programming techinques which you may
not use yourself, _do_ miss their presence in languages in which you
consider their absence to be a feature.

Python has many qualities, but let's stop kidding ourselves that its
current state is some sort of global optimum in the space of
programming languages.

In spite of its many qualities, Python has a number of
shortcomings. Let's stop kidding ourselves that its shorcomings are
features.

Python's naff support for anonymous closures is a shortcoming, not a
feature.


[*] By "you" I mean "one", not "Skip Montanaro".



More information about the Python-list mailing list