By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,932 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,932 IT Pros & Developers. It's quick & easy.

decorating classes with metaclass

P: n/a
Just wondering whether anyone has discussed using decorator
syntax to effect metaclass processing. E.g.

@MC
class Foo(object):
pass

would have the same effect as

class Foo(object):
__metaclass__ = MC
pass

ISTM fairly analogous to function decoration, just
differing in the arguments passed.

Regards,
Bengt Richter
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Class decoration was discussed back when (you can search for the thread
in python-dev); not as an alias to metaclasses but discussed as having
exactly the same semantics as function decoration. Maybe the idea has
more merit as being another way of setting the __metaclass__ attribute;
on the other hand: it doesn't increase visibility and what is does and
how it does it is very different from that of function decoration; so
perhaps not.

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.