list equal to subclass of list?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu May 12 20:18:01 EDT 2011


On Thu, 12 May 2011 09:43:23 -0700, Ethan Furman wrote:

> MyList is a list -- just a more specific kind of list -- as can be seen
> from its mro; this is analogous to a square (2 sets of parallel lines
> joined at 90 degree angles, both sets being the same length) also being
> a rectangle (2 sets of parallel lines joined at 90 degree angles).

Possibly the worst analogy ever! *wink*

http://en.wikipedia.org/wiki/Circle-ellipse_problem

Also known as the square-rectangle problem.

A better analogy might be, Lassie is a dog, and Flipper is a dolphin, so 
they are different types of animal. But both dogs and dolphins are 
mammals, so in that sense, Lassie and Flipper are both mammals and 
therefore the same type of animal. It depends on what you mean by "type".



-- 
Steven



More information about the Python-list mailing list