How can I declare a few methods with the same name, but with different numbers of parameters or different types in one class?
What must I change in the following class?>
You can't. There are not overloads or multimethods or similar things. One name refers to one thing. As far as the language is concerned anyway, you can always emulate them yourself... You could check types with isinstance
(but please do it properly - e.g. in Python 2, use basestring
to detect both strings and unicode), but it's ugly, generally discouraged and rarely useful. If the methods do different things, give them different names. Consider polymorphism as well.