Possible Duplicate:
What is a clean, pythonic way to have multiple constructors in Python?
Is it not possible to define multiple constructors in Python, with different signatures? If not, what’s the general way of getting around it?
For example, let’s say you wanted to define a class City
.
I’d like to be able to say someCity = City()
or someCity = City("Berlin")
, where the first just gives a default name value, and the second defines it.