Python's idiom for function overloads

Frans Englich frans.englich at telia.com
Mon Jan 31 23:17:10 EST 2005


Hello,

Since Python doesn't have static typing, how is the same result as traditional 
function overloads results in acheived? With function overloads the 
"selection of code path depending on data type" is transparent and automatic 
since the typing system figure out what goes to what.

But in Python, when one wants to be able to pass different data types into a 
single "entry point" for functionality, how is that best done? To in a 
function do an if statement with the type() function? 


Cheers,

		Frans




More information about the Python-list mailing list