This patch is modeled on the original @ patch #979728
Functions are now ignorant of their decorated status.
The regular function & class functions are called from
the com_decorated_thing() function which applies the
decorators. the new Grammar production is
decorated_thing: decorators (funcdef|classdef)
passes all tests (including augmented test_decorators)
com_decorated_thing() in compile.c uses a VAR_LOAD to
get the class/function to decorate. There is probably
an easier way to do this.
I updated the compiler package (ast.txt, pycodegen.py,
symbols.py, transformer.py) and it passes all tests but
I'm not sure it is correct (the tests pass as long as
they don't throw an exception).
|