[Python-Dev] RE: Hot-To Guide for Descriptors (original) (raw)
Chermside, Michael mchermside at ingdirect.com
Wed Jan 21 15:19:22 EST 2004
- Previous message: [Python-Dev] Configure option to change Python's name?
- Next message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-Dev] Configure option to change Python's name?
- Next message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]