mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Patch #1601678: move intern() to sys.intern().
This commit is contained in:
parent
376446dd4e
commit
66a796e5ab
12 changed files with 81 additions and 73 deletions
|
@ -1,5 +1,6 @@
|
|||
from pybench import Test
|
||||
from string import join
|
||||
import sys
|
||||
|
||||
class ConcatStrings(Test):
|
||||
|
||||
|
@ -174,7 +175,7 @@ class CompareInternedStrings(Test):
|
|||
def test(self):
|
||||
|
||||
# Make sure the strings *are* interned
|
||||
s = intern(join(map(str,range(10))))
|
||||
s = sys.intern(join(map(str,range(10))))
|
||||
t = s
|
||||
|
||||
for i in xrange(self.rounds):
|
||||
|
@ -240,7 +241,7 @@ class CompareInternedStrings(Test):
|
|||
|
||||
def calibrate(self):
|
||||
|
||||
s = intern(join(map(str,range(10))))
|
||||
s = sys.intern(join(map(str,range(10))))
|
||||
t = s
|
||||
|
||||
for i in xrange(self.rounds):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue