Metaclasses vs. standard Python reflection?

Andrew Bennetts andrew-pythonlist at puzzling.org
Fri May 2 02:18:40 EDT 2003


On Fri, May 02, 2003 at 01:09:27AM -0500, Ian Bicking wrote:
> In fact, I think they are much more complex than they need be.  I'd
> rather have it implemented something like:
> 
> class SQLObject(object):
> 
>     def __newclass__(className, bases, vardict):
>         # change vardict, perhaps...
>         cls = object.__newclass__(className, bases, vardict)
>         # do more stuff...
>         return cls

You can probably write a metaclass to support this <wink>.

-Andrew.






More information about the Python-list mailing list