Is there a consensus on how to check a polymorphic instance?

Dan Perl danperl at rogers.com
Tue Nov 23 14:55:54 EST 2004


"Donn Cave" <donn at u.washington.edu> wrote in message 
news:donn-910064.10130823112004 at gnus01.u.washington.edu...
> Not only are there many definitions of polymorphism, there are
> several kinds of polymorphism, each with many definitions.  You
> could spend some time with a web search engine and get lots of
> reading material on this, and I think you would find that a good
> deal of it is coming from a point of view that kind of tends to
> ignore object oriented programming altogether.  Check it out.
> If you want to stay with the more immediately relevant OOP
> thinking on this, search for polymorphism and smalltalk.
>
> Note that C++ and Java need two mechanisms in support of something
> approximating parametric polymorphism.  The subtype polymorphism
> I think you're thinking of is the classic OO device, but it doesn't
> support really generic functions and types.  The template system
> has been bolted onto these languages (I gather Java has one now)
> for this purpose.  With these two mechanisms, they more or less
> support parametric polymorphism, in a statically typed, compiled
> language.  Python is not statically typed, of course, so where
> the literature about parametric polymorphism focuses on types
> you have to decide for yourself how important that is in principle.
> In the end it of course doesn't really matter what you call it.

Yes, you are right, subtype polymorphism is what I had in mind and I was 
implicitly questioning on the acceptance of 'polymorphism' as one type or 
the other, even though I was not aware of the formal separation between the 
two types.  Having learned of polymorphism years ago in the C++ and Java 
context where it was used only the sense of subtype polymorphism, it was 
still the way I interpreted the term in the subject line of this thread. 
>From now on I will keep in mind the more general meaning of parametric 
polymorphism.

Dan

>   Donn Cave, donn at u.washington.edu 





More information about the Python-list mailing list