diff options
| author | Alexandre Vassalotti <alexandre@peadrop.com> | 2010-01-09 23:35:54 (GMT) |
|---|---|---|
| committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2010-01-09 23:35:54 (GMT) |
| commit | ee936a21308679654b2d458166ff094ed735fef7 (patch) | |
| tree | 612cd109e8ede4080f58f30ece3212d8e0f996d2 /Lib/test/test_grammar.py | |
| parent | e36561352895170f28f77f0b4ec4292e35d1cc01 (diff) | |
| download | cpython-ee936a21308679654b2d458166ff094ed735fef7.zip cpython-ee936a21308679654b2d458166ff094ed735fef7.tar.gz cpython-ee936a21308679654b2d458166ff094ed735fef7.tar.bz2 | |
Issue #2335: Backport set literals syntax from Python 3.x.
Diffstat (limited to 'Lib/test/test_grammar.py')
| -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 f144ae7..4713d1a 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -749,7 +749,7 @@ hello world def testAtoms(self): ### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING - ### dictmaker: test ':' test (',' test ':' test)* [','] + ### dictorsetmaker: (test ':' test (',' test ':' test)* [',']) | (test (',' test)* [',']) x = (1) x = (1 or 2 or 3) @@ -769,6 +769,11 @@ hello world x = {'one': 1, 'two': 2,} x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6} + x = {'one'} + x = {'one', 1,} + x = {'one', 'two', 'three'} + x = {2, 3, 4,} + x = `x` x = `1 or 2 or 3` self.assertEqual(`1,2`, '(1, 2)') |
