On Sat, Jun 19, 2010 at 8:56 PM, Zubin Mithra <zubin.mit...@gmail.com> wrote: > Hi everyone, > > I think I`m missing something very basic or have a very basic concept > understood the wrong way, so I`d like to have some help here.
Before, the real important thing, it would help to analyze these: What will happen in this snippet: class C: def a(self, a): print a def a(self, a, b=None): print a, b obj = C() obj.a(10) obj.a(10,20) And in this snippet: class C: def a(self, a, b=None): print a, b def a(self, a): print a obj = C() obj.a(10) obj.a(10,20) You will see that second one fails and the last method in the definition is taken as the signature all the times. ( I am trying to find a reference explanation, but i can't get), which also leads to The real important thing. :) These are not a good ways of doing in Python. In Python, all member functions are effectively 'virtual'. The last I saw these kind of methods were when studying C++ about virtual methods. You might just want to define a single method with the variable parameters set to a default, if you want to have any flexibility in invocation. -- Senthil _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers