Author: Carl Friedrich Bolz <[email protected]>
Branch: dict-strategies
Changeset: r44537:b77aacded28e
Date: 2011-05-27 10:06 +0200
http://bitbucket.org/pypy/pypy/changeset/b77aacded28e/
Log: rpython fixes
diff --git a/pypy/objspace/std/dictmultiobject.py
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -382,7 +382,7 @@
return self.erase(new_dict)
def iter(self, w_dict):
- return RDictIteratorImplementation(self.space, w_dict)
+ return RDictIteratorImplementation(self.space, self, w_dict)
def keys(self, w_dict):
return self.unerase(w_dict.dstorage).keys()
@@ -431,13 +431,13 @@
return self.unerase(w_dict.dstorage).get(key, None)
def iter(self, w_dict):
- return StrIteratorImplementation(self.space, w_dict)
+ return StrIteratorImplementation(self.space, self, w_dict)
class StrIteratorImplementation(IteratorImplementation):
- def __init__(self, space, dictimplementation):
+ def __init__(self, space, strategy, dictimplementation):
IteratorImplementation.__init__(self, space, dictimplementation)
- dict_w =
dictimplementation.strategy.unerase(dictimplementation.dstorage)
+ dict_w = strategy.unerase(dictimplementation.dstorage)
self.iterator = dict_w.iteritems()
def next_entry(self):
@@ -449,9 +449,9 @@
class RDictIteratorImplementation(IteratorImplementation):
- def __init__(self, space, dictimplementation):
+ def __init__(self, space, strategy, dictimplementation):
IteratorImplementation.__init__(self, space, dictimplementation)
- d = dictimplementation.strategy.unerase(dictimplementation.dstorage)
+ d = strategy.unerase(dictimplementation.dstorage)
self.iterator = d.iteritems()
def next_entry(self):
diff --git a/pypy/objspace/std/dictproxyobject.py
b/pypy/objspace/std/dictproxyobject.py
--- a/pypy/objspace/std/dictproxyobject.py
+++ b/pypy/objspace/std/dictproxyobject.py
@@ -70,7 +70,7 @@
return len(self.unerase(w_dict.dstorage).dict_w)
def iter(self, w_dict):
- return DictProxyIteratorImplementation(self.space, w_dict)
+ return DictProxyIteratorImplementation(self.space, self, w_dict)
def keys(self, w_dict):
space = self.space
@@ -89,9 +89,9 @@
self.unerase(w_dict.dstorage).mutated()
class DictProxyIteratorImplementation(IteratorImplementation):
- def __init__(self, space, dictimplementation):
+ def __init__(self, space, strategy, dictimplementation):
IteratorImplementation.__init__(self, space, dictimplementation)
- w_type =
dictimplementation.strategy.unerase(dictimplementation.dstorage)
+ w_type = strategy.unerase(dictimplementation.dstorage)
self.iterator = w_type.dict_w.iteritems()
def next_entry(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit