diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2007-04-23 11:05:01 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2007-04-23 11:05:01 (GMT) |
commit | 71011e2c2b6511e14099d0a02d8c137bb22784ad (patch) | |
tree | 647b4874e1b4b0360b7f314038e7ffe3317c4e36 /Lib/test | |
parent | 4138bfec0a189d180b7bcb89e7c8ce8a456a6b55 (diff) | |
download | cpython-71011e2c2b6511e14099d0a02d8c137bb22784ad.zip cpython-71011e2c2b6511e14099d0a02d8c137bb22784ad.tar.gz cpython-71011e2c2b6511e14099d0a02d8c137bb22784ad.tar.bz2 |
Allow decorators and return annotations to be used together (fixes SF#1697248)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_grammar.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index bd04735..85be05b 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -322,7 +322,12 @@ class GrammarTests(unittest.TestCase): self.assertEquals(f.__annotations__, {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9, 'k': 11, 'return': 12}) - + # Check for SF Bug #1697248 - mixing decorators and a return annotation + def null(x): return x + @null + def f(x) -> list: pass + self.assertEquals(f.__annotations__, {'return': list}) + # test MAKE_CLOSURE with a variety of oparg's closure = 1 def f(): return closure |