]> granicus.if.org Git - python/commitdiff
PEP 214, Extended print Statement, has been accepted by the BDFL.
authorBarry Warsaw <barry@python.org>
Mon, 21 Aug 2000 15:34:33 +0000 (15:34 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 21 Aug 2000 15:34:33 +0000 (15:34 +0000)
This change modifies Python's grammar to include the extended print
form.

Grammar/Grammar

index 02e2edd0ced5ee303de4ae3fb58eabe1af78137f..f95923d413801a70ec43b7dfd4283f5a16bcea16 100644 (file)
@@ -30,10 +30,10 @@ fplist: fpdef (',' fpdef)* [',']
 stmt: simple_stmt | compound_stmt
 simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
 #small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
-small_stmt: expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
+small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
 expr_stmt: testlist ('=' testlist)*
 # For assignments, additional restrictions enforced by the interpreter
-print_stmt: 'print' (test ',')* [test]
+print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] )
 del_stmt: 'del' exprlist
 pass_stmt: 'pass'
 flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt