mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
and make it 2.6-compatible.
This commit is contained in:
parent
7bf8d4ed4d
commit
8a68122e9c
7 changed files with 40 additions and 19 deletions
|
@ -1,6 +1,12 @@
|
|||
from pybench import Test
|
||||
import sys
|
||||
|
||||
try:
|
||||
intern
|
||||
except NameError:
|
||||
intern = sys.intern
|
||||
|
||||
|
||||
class ConcatStrings(Test):
|
||||
|
||||
version = 2.0
|
||||
|
@ -174,7 +180,7 @@ class CompareInternedStrings(Test):
|
|||
def test(self):
|
||||
|
||||
# Make sure the strings *are* interned
|
||||
s = sys.intern(''.join(map(str,range(10))))
|
||||
s = intern(''.join(map(str,range(10))))
|
||||
t = s
|
||||
|
||||
for i in range(self.rounds):
|
||||
|
@ -240,7 +246,7 @@ class CompareInternedStrings(Test):
|
|||
|
||||
def calibrate(self):
|
||||
|
||||
s = sys.intern(''.join(map(str,range(10))))
|
||||
s = intern(''.join(map(str,range(10))))
|
||||
t = s
|
||||
|
||||
for i in range(self.rounds):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue