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 try multimethods in Python:
http://www.artima.com/weblogs/viewpost.jsp?thread=101605
But I don't believe multimethod is a way to go. Rather objects that you pass to a method should have common interface. You are trying to achieve method overloading similar to the one in C++, but it is very rarely required in Python. One way to do this is a cascade of ifs
using isinstance
, but that's ugly.