Overloading

Josef Meile jmeile at hotmail.com
Fri Dec 9 14:26:21 EST 2005


>>In C++ you can overload functions and constructors. For example if I have a
>>class that represents a complex number, than it would be nice if I can
>>write two seperate constructors
> 
> 
> Python doesn't support this, but it does support default arguments:
Yes, in part you are right since the python core doesn't include them.
However they can be implemented with decorators:

* Subject: decorators and multimethods
   Group:   comp.lang.python
   Link:    http://tinyurl.com/d45ym

Anyway, as you, I also use the default arguments.

Regards
Josef




More information about the Python-list mailing list