Syntax modification idea: (classmethods, properties locking...)

Jp Calderone exarkun at intarweb.us
Fri Jan 24 22:46:13 CET 2003


On Fri, Jan 24, 2003 at 02:59:30PM -0600, Ian Bicking wrote:
> On Fri, 2003-01-24 at 08:19, Michele Simionato wrote:
> > Ian Bicking <ianb at colorstudy.com> wrote in message news:<mailman.1043356128.29302.python-list at python.org>...
> > > [snip]
> > 
> > You want
> > 
> > __metaclass__=type('DoubleMetaclass',(PropMetaclass, SomeOtherMetaclass),{})
> 
> Okay, now what does that *mean*? :)  (It doesn't seem to be in the
> documentation)
> 

It's the same as:

class DoubleMetaClass(PropMetaclass, SomeOtherMetaclass):
    pass

type() takes either 1 argument, in which case it returns the type of the
parameter, or 3 arguments, in which case it acts as a metaclass (Woo!) and
returns a new type-object with the specified name, bases, and attributes.

  Jp

-- 
"There is no reason for any individual to have a computer in their
home."
                -- Ken Olson, President of DEC, World Future Society
                   Convention, 1977
-- 
 up 40 days, 1:49, 7 users, load average: 0.60, 0.63, 0.62
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030124/363e5a31/attachment.pgp>


More information about the Python-list mailing list