polymorphism (was Re: Type checking in python?)

Paul Duffin pduffin at hursley.ibm.com
Fri Jul 28 05:56:29 EDT 2000


Oivvio Polite wrote:
> 
> After all this I still don't get the difference between polymorphism and
> overloading. I've just ordered a book on OO design. So maybe that
> distinction will become clearer to me, then again, maybe it won't :)
> 

An overloaded function is a function whose behaviour is dependent on the
type of information you give it. The types of information that the function
supports is limited by the implementation of the function.

A polymorphic function is a function whose behaviour is independent of the
type of information you give it. The types of information that the function
supports is limited to those types which support the set of operations that
the function requires.



More information about the Python-list mailing list