diff options
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 b64fcdf..3e7318a 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -612,6 +612,12 @@ print [3 * x for x in nums] print [x for x in nums if x > 2] print [(i, s) for i in nums for s in strs] print [(i, s) for i in nums for s in [f for f in strs if "n" in f]] + +def test_in_func(l): + return [None < x < 3 for x in l if x > 2] + +print test_in_func(nums) + try: eval("[i, s for i in nums for s in strs]") print "FAIL: should have raised a SyntaxError!" |