On Thu, 12 May 2005 13:00:45 -0700 (PDT), Carlos Moreira <[EMAIL PROTECTED]> wrote:
> Look, I don't want to use things like: > .... > def myMethod(self, myValue=None): > if(not myValue): > self.myAttribute += 1 > else: > self.myAttribute += myValue > .... How about: def myMethod( self, myValue = 1 ): self.myAttribute += myValue Callers of myMethod look exactly like they would look if you had written two methods: a.myMethod( ) # add 1 to a.myAttribute a.myMethod( 22 ) # add 22 to a.myAttribute > I want to use the power of polymorphism to modelate the problem. Polymorphism in Python is a solution looking for a problem. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list