
Jan. 22, 2004
2:05 a.m.
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