diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 17:49:41 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-18 17:49:41 (GMT) |
commit | 34ce99f66db84cabaaee04878e30aa8850518ce5 (patch) | |
tree | 3af6ed3869a6324c7a5014eef17658f9b097dca5 /Lib/test/test_grammar.py | |
parent | b59e4425d5476117b77db6a6ee9561f56b8a252a (diff) | |
download | cpython-34ce99f66db84cabaaee04878e30aa8850518ce5.zip cpython-34ce99f66db84cabaaee04878e30aa8850518ce5.tar.gz cpython-34ce99f66db84cabaaee04878e30aa8850518ce5.tar.bz2 |
Mangle __parameters in __annotations__ dict properly. Issue #20625.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 6b326bd..9da6338 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -314,6 +314,13 @@ class GrammarTests(unittest.TestCase): self.assertEqual(f.__annotations__, {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9, 'k': 11, 'return': 12}) + # Check for issue #20625 -- annotations mangling + class Spam: + def f(self, *, __kw:1): + pass + class Ham(Spam): pass + self.assertEquals(Spam.f.__annotations__, {'_Spam__kw': 1}) + self.assertEquals(Ham.f.__annotations__, {'_Spam__kw': 1}) # Check for SF Bug #1697248 - mixing decorators and a return annotation def null(x): return x @null |