Author: collin.winter Date: Sat Jul 14 20:56:19 2007 New Revision: 56376 Modified: python/branches/p3yk/Lib/test/test_grammar.py Log: Add an example of class decorators to test_grammar.
Modified: python/branches/p3yk/Lib/test/test_grammar.py ============================================================================== --- python/branches/p3yk/Lib/test/test_grammar.py (original) +++ python/branches/p3yk/Lib/test/test_grammar.py Sat Jul 14 20:56:19 2007 @@ -697,6 +697,13 @@ def meth2(self, arg): pass def meth3(self, a1, a2): pass + # decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE + # decorators: decorator+ + # decorated: decorators (classdef | funcdef) + def class_decorator(x): return x + @class_decorator + class G: pass + def testListcomps(self): # list comprehension tests nums = [1, 2, 3, 4, 5] _______________________________________________ Python-3000-checkins mailing list Python-3000-checkins@python.org http://mail.python.org/mailman/listinfo/python-3000-checkins