Instantiating classes which are derived from built-in types.

Alex Martelli aleax at mail.comcast.net
Tue Nov 29 05:25:32 CET 2005


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> aleax at mail.comcast.net (Alex Martelli) writes:
> > A is oldstyle -- a wart existing for backwards compatibility.
> 
> I think it's time for "from __future__ import newclasses" since
> I hate having to type "class A(object):" instead of "class A:"
> all over the place.

Use __metaclass__=type exactly in the same location where you'd want to
import from __future__ and you will get exactly the same functionality.


Alex



More information about the Python-list mailing list