[Python-3000-checkins] r56376 - python/branches/p3yk/Lib/test/test_grammar.py
collin.winter
python-3000-checkins at python.org
Sat Jul 14 20:56:19 CEST 2007
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]
More information about the Python-3000-checkins
mailing list