other python ideas

Martijn Faassen m.faassen at vet.uu.nl
Tue May 23 10:33:16 EDT 2000


Richard Brodie <R.Brodie at rl.ac.uk> wrote:

> "Thomas Thiele" <thiele at muc.das-werk.de> wrote in message news:392A7F84.A3D5F34A at muc.das-werk.de...
>> function overloading is a goog idea. It's really the only thing I miss in
>> python.
>> But then it must be possible to check different data-types (like in C++).
>>
>> def foo(   (int)a  ):
>>     print a, "is a int"
>>
>> def foo(   (float)a  ):
>>     print a, " is a float"

> It's not so hard to write a dispatch function if that's what you really want:

[snip dispatch function]

I think the idea is that we don't want to write these dispatch tables
and functions by hand, just like we're not writing dispatch tables for
classes by hand (eminently possible too and not much of a hassle in
Python). I'm not entirely convinced this would be a good idea, though,
because I think there are all kinds of subtle semantic difficulties 
that we haven't thought up yet. Also there may be potential misuses or
hard to track down errors resulting from this.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list