Overloading Methods

TheFlyingDutchman zzbbaadd at aol.com
Tue Jan 20 21:34:19 EST 2009


>
> class Foo(object):
>     def __init__(self, a, b=10, c=None):

>
> Whereas in Java or C++ this would require several overloads, it can be
> succinctly expressed as a single method in Python.
>

Not that it's important to the discussion, but, while Java does not
have the capability to give default method parameters, C++ does.




More information about the Python-list mailing list