From: Barry Warsaw Date: Mon, 21 Aug 2000 15:46:50 +0000 (+0000) Subject: PEP 214, Extended print Statement, has been accepted by the BDFL. X-Git-Tag: v2.0b1~329 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efc92eec3377819476f5b0cd0f6afe64baeb0df2;p=thirdparty%2FPython%2Fcpython.git PEP 214, Extended print Statement, has been accepted by the BDFL. Additional test cases for the extended print form. --- diff --git a/Lib/test/output/test_grammar b/Lib/test/output/test_grammar index b075d35fe197..203cf1877420 100644 --- a/Lib/test/output/test_grammar +++ b/Lib/test/output/test_grammar @@ -19,6 +19,10 @@ print_stmt 1 2 3 1 2 3 1 1 1 +extended print_stmt +1 2 3 +1 2 3 +1 1 1 del_stmt pass_stmt flow_stmt diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 8eb552261cec..da74444d416f 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, '', '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)