Functions, Operators, and Overloading?

Gerhard Fiedler gelists at gmail.com
Mon Jul 24 13:52:24 EDT 2006


On 2006-07-24 14:30:31, Brian Beck wrote:

> Michael Yanowitz wrote:
>>    Maybe I am missing something, but from what I've seen,
>> it is not possible to overload functions in Python. That
>> is I can't have a
>>   def func1 (int1, string1):
>>    and a
>>   def func1 (int1, int3, string1, string2):
>>     without the second func1 overwriting the first.
> 
> Correct.

Can you write a function that accepts any number of arguments? And then
branch based on the number of arguments supplied?

I guess you can do that with a list as only argument. But can that be done
using the "normal" function argument notation?

Gerhard




More information about the Python-list mailing list