[Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.14,1.15
Barry Warsaw
python-dev@python.org
Mon, 21 Aug 2000 08:46:26 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24962
Modified Files:
test_grammar.py
Log Message:
PEP 214, Extended print Statement, has been accepted by the BDFL.
Additional test cases for the extended print form.
Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** test_grammar.py 2000/08/12 18:09:51 1.14
--- test_grammar.py 2000/08/21 15:46:24 1.15
***************
*** 261,264 ****
--- 261,283 ----
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