A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-January/042184.html below:

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

[Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-) [Python-Dev] RE: Hot-To Guide for Descriptors - Nits! :-)Jeremy Hylton jeremy at alum.mit.edu
Wed Jan 21 21:05:02 EST 2004
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



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4