[Python-checkins] python/nondist/sandbox/parrotbench b5.py,1.4,1.5

gvanrossum at users.sourceforge.net gvanrossum at users.sourceforge.net
Wed Dec 31 11:45:38 EST 2003


Update of /cvsroot/python/python/nondist/sandbox/parrotbench
In directory sc8-pr-cvs1:/tmp/cvs-serv20841
Modified Files:
	b5.py 
Log Message:
Add some variation.
Index: b5.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b5.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** b5.py	31 Dec 2003 07:54:58 -0000	1.4
--- b5.py	31 Dec 2003 16:45:36 -0000	1.5
***************
*** 21,40 ****
 exc.__name__, f.__name__, args)
 
! def check_functions():
! check(abs(42), 42)
! check(abs(-42), 42)
! check(abs(-12345678910), 12345678910)
! check(abs(-3.14), 3.14)
! check(abs(3j+4), 5)
 
! check(bool(1), True)
! check(bool(100), True)
! check(bool(0), False)
! check(bool([1,2,3]), True)
! check(bool([]), False)
! check(bool({1: 2}), True)
 check(bool({}), False)
 
! check(complex(3, 4), 3+4j)
 
 check(dict([(1,2), (3,4)]), {1: 2, 3: 4})
--- 21,40 ----
 exc.__name__, f.__name__, args)
 
! def check_functions(i=0, j=0):
! check(abs(42*i), 42*j)
! check(abs(-42*i), 42*j)
! check(abs(-12345678910*i), 12345678910*j)
! check(abs(-3.14*i), 3.14*i)
! check(abs((3j+4)*i), 5*j)
 
! check(bool(1+i), True)
! check(bool(100+j), True)
! check(bool(i-j), False)
! check(bool([i, j]), True)
! check(bool([i, j][i:j]), False)
! check(bool({i: j}), True)
 check(bool({}), False)
 
! check(complex(3*i, 4*j), 3*i+4j*j)
 
 check(dict([(1,2), (3,4)]), {1: 2, 3: 4})
***************
*** 49,53 ****
 
 check(float("1.5"), 1.5)
! check(float(15), 15.0)
 check(float(10**100), 1e100)
 
--- 49,53 ----
 
 check(float("1.5"), 1.5)
! check(float(15*i), 15.0*j)
 check(float(10**100), 1e100)
 
***************
*** 238,242 ****
 [('a', 'd', 'g'), ('b', 'e', 'h'), ('c', 'f', 'i')])
 
! def check_descriptors():
 
 class C0(object):
--- 238,242 ----
 [('a', 'd', 'g'), ('b', 'e', 'h'), ('c', 'f', 'i')])
 
! def check_descriptors(i, j):
 
 class C0(object):
***************
*** 365,370 ****
 show = True
 for i in range(500):
! check_functions()
! check_descriptors()
 show = False
 print "OK."
--- 365,370 ----
 show = True
 for i in range(500):
! check_functions(j=long(i*1000000), i=i*1000000)
! check_descriptors(j=long(i*1000000), i=i*1000000)
 show = False
 print "OK."


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /