Possible Duplicate:
How do I use method overloading in Python?
I am new to Python programming, and I like to write multiple methods with the same name, but why only the method which is called recently get printed?
Code is below:
class A:
def mymethod(self):
print 'first method'
def mymethod(self):
print 'second method'
ob = A()
ob.mymethod()
With the output as second method
.
What is the mechanism behind this Python method calling? Can I call two methods of the same name at the same time?