[Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)

Chermside, Michael mchermside at ingdirect.com
Wed Jan 21 15:19:22 EST 2004


François Pinard writes:
> Would it be more precise to state:
> "... new style objects or classes (those for which the meta-class is a
> subtype of `type')"?  Being sub-classed from object or type is just a
> way, among others, for identifying `type' as the meta-class; but being
> sub-classed from object is not really required.

Raymond Hettinger responds:
> Nope, new-style is taken to mean objects/classes inheriting from
> object/type.  Meta-class objects are neither new-style nor old-style.
> While there is room to argue with this arbitrary distinction, it is
> consistent with Guido's essay and especially relevant to my article
> because most of the rules don't necessarily apply when meta-classes
> are used.  This is because the machinery for descriptors is 
> embedded in type.__getattribute__ and object.__getattribute__.  
> Override or fail to inherit either of these and all bets are off.

Really? I realize the utility of having a term for objects-with-a-
meta-type-of-type, but I had always understood "new-style" to mean
things-that-are-not-old-style-classes. I can live with either
definition, but the Python community should make sure that we use
the term "new-style class" in a consistent fashion.

Did everyone else agree with Raymond so François and I are the odd
men out, or is there a larger confusion over how we use the term?

-- Michael Chermside


This email may contain confidential or privileged information. If you believe you have received the message in error, please notify the sender and delete the message without copying or disclosing it.




More information about the Python-Dev mailing list