diff options
author | Barry Warsaw <barry@python.org> | 2000-08-21 15:46:50 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2000-08-21 15:46:50 (GMT) |
commit | efc92eec3377819476f5b0cd0f6afe64baeb0df2 (patch) | |
tree | bb88c8bb73d7836220618997b4f519d4887a8c24 /Lib/test/test_grammar.py | |
parent | 8c0a242289d0da855ec10c763cc2020954da1184 (diff) | |
download | cpython-efc92eec3377819476f5b0cd0f6afe64baeb0df2.zip cpython-efc92eec3377819476f5b0cd0f6afe64baeb0df2.tar.gz cpython-efc92eec3377819476f5b0cd0f6afe64baeb0df2.tar.bz2 |
PEP 214, Extended print Statement, has been accepted by the BDFL.
Additional test cases for the extended print form.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 8eb5522..da74444 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -260,6 +260,25 @@ print print 0 or 1, 0 or 1, print 0 or 1 +print 'extended print_stmt' # 'print' '>>' test ',' +import sys +print >> sys.stdout, 1, 2, 3 +print >> sys.stdout, 1, 2, 3, +print >> sys.stdout +print >> sys.stdout, 0 or 1, 0 or 1, +print >> sys.stdout, 0 or 1 + +# syntax errors +def check_syntax(statement): + try: + compile(statement, '<string>', 'exec') + except SyntaxError: + pass + else: + print 'Missing SyntaxError: "%s"' % statement +check_syntax('print ,') +check_syntax('print >> x,') + print 'del_stmt' # 'del' exprlist del abc del x, y, (z, xyz) |