[Tutor] constructors
Alexandre Ratti
alex@gabuzomeu.net
Fri, 12 Apr 2002 12:57:16 +0200
Hello,
At 05:33 12/04/2002 -0400, you wrote:
>From: Prahlad Vaidyanathan <slime@vsnl.net>
>Subject: Re: [Tutor] constructors
>Date: Fri, 12 Apr 2002 04:29:25 -0400
> > Since Python is loosely/weakly/dynamically typed, does initializing
> > really matter a great deal? Or is it just to allow us to use
> > polymorphism in a later method (by not requiring that later method to
>
>Ok, taking the risk of sounding *very* duh,
>
> What does polymorphism mean ?
>
>Going by it's name, it probably involves changing something (method,
>variable, etc.) many times. Is this the same as over-riding a method of
>the base class during inheritance ?
Here is a definition I came across:
<QUOTE>
Generally, the ability to appear in many forms. In object-oriented
programming, polymorphism refers to a programming language's ability to
process objects differently depending on their data type or class. More
specifically, it is the ability to redefine methods for derived classes.
For example, given a base class shape, polymorphism enables the programmer
to define different circumference methods for any number of derived
classes, such as circles, rectangles and triangles. No matter what shape an
object is, applying the circumference method to it will return the correct
results. Polymorphism is considered to be a requirement of any true
object-oriented programming language (OOPL).
The type of polymorphism described above is sometimes called parametric
polymorphism to distinguish it from another type of polymorphism called
overloading.
</QUOTE>
Source: http://webopedia.lycos.com/TERM/P/polymorphism.html
See also: http://www.ibiblio.org/obp/thinkCSpy/chap14.htm#9
Cheers.
Alexandre