AttributeError in "with" statement (3.2.2)

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Dec 15 15:34:52 EST 2011


MRAB wrote:

>> To give an analogy, it is like defining mammals as "hairy animals which
>> give birth to live young", which is correct for all mammals except for
>> monotremes, which are mammals which lay eggs.
>
> Or the naked mole-rat. Or cetaceans (whales).

The way I understand it, the main characteristic shared by
all mammals is the presence of mammary glands in females.

To wrest this back on topic, sometimes a definition
can be improved without making it any more complicated.

In the case of methods, perhaps instead of "defined inside
a class body" it could say "bound to a name in a class
namespace". That's what really matters, not how it came to
be there.

-- 
Greg



More information about the Python-list mailing list