[pypy-svn] r13570 - pypy/dist/pypy/rpython
tismer at codespeak.net
tismer at codespeak.net
Sat Jun 18 01:15:36 CEST 2005
Author: tismer
Date: Sat Jun 18 01:15:34 2005
New Revision: 13570
Modified:
pypy/dist/pypy/rpython/rlist.py
Log:
changed list_cache to use Constant, just in
case we want to pickle such things.
Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py (original)
+++ pypy/dist/pypy/rpython/rlist.py Sat Jun 18 01:15:34 2005
@@ -59,11 +59,12 @@
if not isinstance(listobj, list):
raise TyperError("expected a list: %r" % (listobj,))
try:
- return self.list_cache[id(listobj)][1]
+ key = Constant(listobj)
+ return self.list_cache[key][1]
except KeyError:
self.setup()
result = malloc(self.LIST, immortal=True)
- self.list_cache[id(listobj)] = listobj, result
+ self.list_cache[key] = listobj, result
result.items = malloc(self.LIST.items.TO, len(listobj))
r_item = self.item_repr
for i in range(len(listobj)):
More information about the Pypy-commit
mailing list