Another try at Python's selfishness

Donn Cave donn at drizzle.com
Sat Feb 4 01:50:46 EST 2006


Quoth n.estner at gmx.de:
| > Still see no problem.  Of course, it goes without saying that
| > Python 2.4 doesn't work this way, but given that it's theoretically
| > possible for f(a) to be resolved similarly to a.f, then I really
| > do not see what you're seeing here.  The kwargs parameter appears
| > irrelevant from where I'm sitting.
|
| Then either you didn't understand my answers, or I didn't understand
| your idea. Could you summarize how exactly "f(x,y=z)" should be
| resolved, i.e. where it should look for "f"?

a.f ==> f(a)

I would agree that I didn't understand your answers, but they weren't
really answers so much as questions, along the lines of ``well then,
how would this work?''  I seem to have missed what you were driving at,
but maybe if you were to just came out and explain the point?

Of course the whole business is kind of a joke, since there is no way
anyone in their right mind would wish to change Python's notation for
such trivial reasons, but there actually are languages that resolve
functions based on argument types.  Overloading in C++ is somewhat
like this, Haskell's typeclass mechanism, and there is a ``multiple
dispatch'' model that I have no experience with but is not without its
supporters.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list