brownplt / lambda-py

Other
58 stars 10 forks source link

Add support for Class Decorators #64

Closed amtriathlon closed 11 years ago

amtriathlon commented 11 years ago

According to http://www.python.org/dev/peps/pep-3129/ this feature is similar to function decorators, for example this snippet:

@foo
@bar
class A:
  pass

would be desugared to;

class A:
  pass
A = foo(bar(A))

The implementation seems to be very simple, except for the fact decorators should be applied after the class is fully built, which in our class desugar strategy means after the attributes in the class body are set.