[Python-checkins] python/nondist/peps pep-0008.txt,1.17,1.18

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Thu, 17 Oct 2002 08:32:20 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv3154

Modified Files:
	pep-0008.txt 
Log Message:
Added a note on compound statements after remarks from David Goodger.
Make the code samples agree with this recommendation. ;)


Index: pep-0008.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** pep-0008.txt	7 Oct 2002 13:40:41 -0000	1.17
--- pep-0008.txt	17 Oct 2002 15:32:18 -0000	1.18
***************
*** 239,242 ****
--- 239,253 ----
                return magic(r=real, i=imag)
  
+     - Compound statements (multiple statements on the same line) are
+       generally discouraged.
+ 
+           No:  if foo == 'blah': do_blah_thing()
+           Yes: if foo == 'blah':
+                    do_blah_thing()
+ 
+           No:  do_one(); do_two(); do_three()
+           Yes: do_one()
+                do_two()
+                do_three()
  
  Comments
***************
*** 581,586 ****
        types are new in Python 2.3):
  
!         No:  if greeting == True: print "Hello world"
!         Yes: if greeting: print "Hello world"
  
  
--- 592,597 ----
        types are new in Python 2.3):
  
!         No:  if greeting == True:
!         Yes: if greeting: