Re: Python Polymorphism
- From: "infidel" <saint.infidel@xxxxxxxxx>
- Date: 12 May 2005 13:17:32 -0700
carlos> Supose that I want to create two methos (inside a
carlos> class) with exactly same name, but number of
carlos> parameters different
That isn't polymorphism, that's function overloading.
carlos> Look, I don't want to use things like:
carlos>
carlos> def myMethod(self, myValue=None):
carlos> if(not myValue):
carlos> self.myAttribute += 1
carlos> else:
carlos> self.myAttribute += myValue
Pick another language then. Or try:
def myMethod(self, myValue=1):
self.myAttribute += myValue
.
- References:
- Re: Python Polymorphism
- From: Carlos Moreira
- Re: Python Polymorphism
- Prev by Date: Re: Python Polymorphism
- Next by Date: Re: tkinter puzzler
- Previous by thread: Re: Python Polymorphism
- Next by thread: Re: Python Polymorphism
- Index(es):