Builtin dict should be callable, since a dict defines a function

Erik Max Francis max at alcyone.com
Thu Dec 19 23:56:15 EST 2002


Bengt Richter wrote:

> Why not?

Asking "Why not?" is not a very good way to get people to your side when
yours is the marginal opinion.

> They both implement the same input->output function.
> IMO it's an artificial limitation on orthogonality not to be
> able to pass a dict to a place that expects a function.

In my opinion, this argument doesn't lead anywhere.  _Lots_ of
interfaces take inputs and return outputs; in fact, you can argue that
_every_ operation does this (or at least results in side effects instead
of returning outputs).  Does that mean that every interface should be
boiled down to a simple "do" command.

Mapping and calling interfaces are analogous in some ways.  But they
exist as separate entities _so that_ a distinction can be made.  You
want to eliminate that distinction.  What purpose would that serve,
since eliminating the distinction is utterly _trivial_ for every single
Python programmer to do on their own if they so desire?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Whoever contends with the great sheds his own blood.
\__/ Sa'di
    Lsystem / http://www.alcyone.com/pyos/lsystem/
 A Lindenmayer systems explorer in Python.



More information about the Python-list mailing list