On Aug 24, 6:15 pm, Hussein B <[EMAIL PROTECTED]> wrote: > Hey, > Please correct me if I'm wrong but Python doesn't support method > overload, right? > -- > def method(self): > #code > def method(self, data): > #code > -- > The last declaration of method() erase the previous one (like > JavaScript). > Thanks.
Correct. The second declaration overwrites the first. Give data a default argument instead: def method(self, data=None): if data is None: # Normal code else: # data included code Not sure how Pythonic that is, but it should work the way you're requesting... I think. -- http://mail.python.org/mailman/listinfo/python-list