bpo-35814: Allow unpacking in r.h.s of annotated assignment expressions (GH-13760)

This commit is contained in:
Pablo Galindo 2019-06-03 08:34:20 +01:00 committed by GitHub
parent d9677f36fe
commit 8565f6b6db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 3 deletions

View file

@ -454,6 +454,10 @@ class GrammarTests(unittest.TestCase):
exec(stmt, ns)
self.assertEqual(list(ns['f']()), [None])
ns = {"a": 1, 'b': (2, 3, 4), "c":5, "Tuple": typing.Tuple}
exec('x: Tuple[int, ...] = a,*b,c', ns)
self.assertEqual(ns['x'], (1, 2, 3, 4, 5))
def test_funcdef(self):
### [decorators] 'def' NAME parameters ['->' test] ':' suite
### decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE