Re: Python Polymorphism

2005-05-22 Thread Scott David Daniels
Joal Heagney wrote: > ... "If you're sick of answering newbie questions, and don't > think you can do so politely, for the sake of the community, > DON'T!" You're not that necessary. +1 QOTW (or at least FAQ) --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/py

Re: Python Polymorphism

2005-05-22 Thread Joal Heagney
Fredrik Lundh wrote: > (I do find this new "I'm going to nitpick on single sentences, no matter > what context they appears in" trend a bit boring, frankly. if you think > that a statement may be misinterpreted, add a clarification or a footnote. > don't assume that you're the only one who know ho

Re: Python Polymorphism

2005-05-16 Thread Donn Cave
Quoth "=?iso-8859-1?q?Steffen_Gl=FCckselig?=" <[EMAIL PROTECTED]>: | |> Ah, that's not polymorphism; it's method overloading. And AFAIK it is | |> not possible in Python. | It IS polymorphism. Not the one one is usually referring to, but it is. | Overloading is an 'ad hoc'-polymorphism. Or 'bogus'

Re: Python Polymorphism

2005-05-16 Thread Steffen Glückselig
> Ah, that's not polymorphism; it's method overloading. And AFAIK it is > not possible in Python. It IS polymorphism. Not the one one is usually referring to, but it is. Overloading is an 'ad hoc'-polymorphism. regards Steffen -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Polymorphism

2005-05-14 Thread Fredrik Lundh
Alexander Schmolck wrote: > > that's known as multimethods, or multiple dispatch. > > No -- multiple dispatch is something entirely different. if you read the OP's entire post, you'll find that he says what he wants to use multiple methods where "the only difference in them signture are parameter

Re: Python Polymorphism

2005-05-13 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Carlos Moreira wrote: > >> Supose that I want to create two methos (inside a >> class) with exactly same name, but number of >> parameters different: > > that's known as multimethods, or multiple dispatch. No -- multiple dispatch is something entirel

Re: Python Polymorphism

2005-05-12 Thread Fredrik Lundh
Carlos Moreira wrote: > Supose that I want to create two methos (inside a > class) with exactly same name, but number of > parameters different: that's known as multimethods, or multiple dispatch. it's a kind of polymorphism; it's not the only way to do it, nor is it the only thing that qualifie

Re: Python Polymorphism

2005-05-12 Thread infidel
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):

Re: Python Polymorphism

2005-05-12 Thread Roel Schroeven
Carlos Moreira wrote: > So, let's try again. > Supose that I want to create two methos (inside a > class) with exactly same name, but number of > parameters different: > > class myClass: > myAttribute = 0 > def myMethod(self): > self.myAttribute += 1 > def myMethod(self,

Re: Python Polymorphism

2005-05-12 Thread Dan Sommers
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

Re: Python Polymorphism

2005-05-12 Thread Carlos Moreira
--- Fredrik Lundh <[EMAIL PROTECTED]> wrote: > so phrases like > (etc) > > doesn't tell you that polymorphism is a fundamental > part of the language, > and used all over the place. or did you have a > non-OO meaning of the > word in mind? Ok, I prefer to think that I could be more

Re: Python Polymorphism

2005-05-12 Thread Fredrik Lundh
Carlos Moreira wrote: > Are you talking about: > http://docs.python.org/tut/tut.html > > I fear that doesn't exist one word about polymorphism > (in an explicit way). so phrases like "Strings can be concatenated (glued together) with the + operator, and repeated with *" "Like string

Re: Python Polymorphism

2005-05-12 Thread Carlos Moreira
--- Fredrik Lundh <[EMAIL PROTECTED]> wrote: > www.python.org :-/ > > (have you read the tutorial?) Are you talking about: http://docs.python.org/tut/tut.html I fear that doesn't exist one word about polymorphism (in an explicit way). Anyway, I use Python since 2000 year and already use OO P

Re: Python Polymorphism

2005-05-12 Thread Fredrik Lundh
Carlos Moreira wrote: > How could I use Python polymorphism? > Which kind of structures Python give me to use > polymorphism? > Where can I find specific documentation? www.python.org (have you read the tutorial?) -- http://mail.python.org/mailman/listinfo/python-list

Python Polymorphism

2005-05-12 Thread Carlos Moreira
Dear all, How could I use Python polymorphism? Which kind of structures Python give me to use polymorphism? Where can I find specific documentation? Thanks and Best regards. Cadu Moreira __ Do you Yahoo!? Make Yahoo