Function Overloading Without Typechecking

Dave Kuhlman dkuhlman at rexx.com
Thu Jan 24 12:39:52 EST 2002


Michael Chermside <mcherm at destiny.com> wrote:
> 
> I have to confess... I come to Python from the world of static typing, 
> and am still adjusting my mindset to dynamic typing. But I'm interested 
> in learning how to use Python's dynamic typing (as opposed to weak 
> typing) effectively. Frequent comments from Alex Martelli and others 
> suggest that if I really want to write pythonic-ly, I will try NOT to 
> check the types of the values I am passed. Just use it, and unless the 
> caller passed me the wrong kind of thing, it'll work.
> 

I'm rigid.  I believe that overloaded methods are non-Pythonic. 
They are confusing and non-explicit.

Overloaded functions say to me "Don't worry about the type of the
arguments; this function will do the right thing. You don't need to
understand this.

Overloaded functions hide things.  The Python attitude says to make
things explicit.  Therefore, overloaded functions are non-Pythonic.

The designers of Java omitted overloaded operators, I believe,
because overloading operators enables programmers to write
confusing, obfuscated code.  Overloaded functions and methods enable
programmers to do the same thing.

Sorry for the rant.  I just hate it when people try to write code
so that I can't understand it.

And, no, I'm not paranoid.  OK, maybe a little in the late
afternoon.

  - Dave


-- 
Dave Kuhlman
dkuhlman at rexx.com
http://www.rexx.com/~dkuhlman


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list