[Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
Raymond Hettinger
python at rcn.com
Thu Jan 22 13:27:28 EST 2004
> > I think all of the topics are best understood in terms of three
groups:
> > classic classes, new-style classes, and roll your own classes.
Lumping
> > the latter two together won't help one bit.
[Aahz]
> While that's technically true, most of the idiomatic uses of
metaclasses
> that I've seen *do* result in the creation of "normal" new-style
> classes. We don't want to obscure that, either, IMO.
Okay, I've added a paragraph to the descriptor guide:
""" The details above show that the mechanism for descriptors is
embedded in the __getattribute__() methods for object, type, and super.
Classes inherit this machinery when they derive from object or if they
have a meta-class providing similar functionality. Likewise, classes can
turn-off descriptor invocation by overriding __getattribute__().
"""
Raymond Hettinger
More information about the Python-Dev
mailing list