Class equivalence?

Fernando Pérez fperez528 at yahoo.com
Fri Dec 7 11:38:17 EST 2001


Bruce Eckel wrote:

>>>> class Flower: pass
>>>> class Daisy(Flower): pass
>>>> Daisy is Flower
> 0
> 
> What am I missing here?

A Daisy is *A* Flower, not *THE* Flower.

Or in python, an instance of Flower, not the class Flower. Identity 
relationships from the real world of objects carry quite well to the 
world of python objects.

cheers,

f




More information about the Python-list mailing list