diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-02-22 17:26:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 17:26:46 (GMT) |
commit | 7fb94fd7a88f14096a509dddd4d8a979a3912672 (patch) | |
tree | 3da5c3937945504b42faf0ee49b49627a0f5d0ba /Lib/test/test_grammar.py | |
parent | 09487c11a582be1f20d34319a82cfaf72d5c27a5 (diff) | |
download | cpython-7fb94fd7a88f14096a509dddd4d8a979a3912672.zip cpython-7fb94fd7a88f14096a509dddd4d8a979a3912672.tar.gz cpython-7fb94fd7a88f14096a509dddd4d8a979a3912672.tar.bz2 |
bpo-46725: Document starred expressions in for statements (GH-31481)
Automerge-Triggered-By: GH:pablogsal
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 3f5a91a..d35530e 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -1403,6 +1403,12 @@ class GrammarTests(unittest.TestCase): result.append(x) self.assertEqual(result, [1, 2, 3]) + result = [] + a = b = c = [1, 2, 3] + for x in *a, *b, *c: + result.append(x) + self.assertEqual(result, 3 * a) + def test_try(self): ### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] ### | 'try' ':' suite 'finally' ':' suite |