[Python-Dev] RE: Hot-To Guide for Descriptors (original) (raw)
Jeremy Hylton jeremy at alum.mit.edu
Wed Jan 21 21:05:02 EST 2004
- Previous message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Next message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 2004-01-21 at 20:24, François Pinard wrote:
If there is no base class, then "if there's a global variable named metaclass, it is used." So my guess would be that adding a mere
metaclass = type in global scope for a module would make all classes be "new-style", without the need to subclass them from object explicitly.
Unless you define a class that inherits from a base class defined in another module. metaclass does not apply when there are base classes. I prefer to inherit from object, because it is more explicit, and avoids possible confusion when some classes have classic bases.
Jeremy
- Previous message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Next message: [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]