Python's "only one way to do it" philosophy isn't good?

Andy Freeman anamax at earthlink.net
Tue Jun 26 17:59:28 CEST 2007


On Jun 26, 8:49 am, Andy Freeman <ana... at earthlink.net> wrote:
> Map doesn't work on generators or iterators because they're not part
> of the common lisp spec, but if someone implemented them as a library,
> said library could easily include a map that handled them as well.

Note that this is is a consequence of something that Python does
better than lisp.  Far more parts of python are defined in terms of
named operations which are data-type independent.  As a result, they
work on things that the implementor (or spec) never considered.

That said, it's no big deal for a lisp program that needed an enhanced
map that also understands iterators and generators to use it.

Compare that with what a programmer using Python 2.4 has to do if
she'd like the functionality provided by 2.5's with statement.  Yes,
with is "just syntax", but it's extremely useful syntax, syntax that
can be easily implemented with lisp-style macros.








More information about the Python-list mailing list