inline metaclasses

gangesmaster tomerfiliba at gmail.com
Mon Jul 3 14:42:57 EDT 2006


just something i thought looked nice and wanted to share with the rest
of you:

>>> class x(object):
...     def __metaclass__(name, bases, dict):
...             print "hello"
...             return type(name, bases, dict)
...
hello
>>>

instead of defining a separate metaclass function/class, you can do
it inline. isn't that cool?


-tomer




More information about the Python-list mailing list