[Python-checkins] python/dist/src/Demo/classes Rat.py,1.6,1.7

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
Thu, 24 Apr 2003 09:59:48 -0700


Update of /cvsroot/python/python/dist/src/Demo/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv20316

Modified Files:
	Rat.py 
Log Message:
Avoid TypeError by not comparing complex numbers

Index: Rat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/classes/Rat.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Rat.py	9 Sep 1998 14:07:06 -0000	1.6
--- Rat.py	24 Apr 2003 16:59:45 -0000	1.7
***************
*** 302,306 ****
  		print
  		for j in list:
! 			print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
  
  if __name__ == '__main__':
--- 302,311 ----
  		print
  		for j in list:
! 			print i + j, i - j, i * j, i / j, i ** j,
!                         if not (isinstance(i, ComplexType) or
!                                 isinstance(j, ComplexType)):
!                                 print cmp(i, j)
!                         print
! 
  
  if __name__ == '__main__':