Author: Armin Rigo <[email protected]>
Branch: all_ordered_dicts
Changeset: r75321:87900ff58c9a
Date: 2015-01-13 19:21 +0100
http://bitbucket.org/pypy/pypy/changeset/87900ff58c9a/
Log: more translation 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
@@ -261,7 +261,7 @@
def nondescr_reversed_dict(self, space):
"""Not exposed directly to app-level, but via __pypy__.reversed_dict().
"""
- if self.strategy.getiterreversed is not None:
+ if self.strategy.has_iterreversed:
it = self.strategy.iterreversed(self)
return W_DictMultiIterKeysObject(space, it)
else:
@@ -512,7 +512,8 @@
def getiteritems(self, w_dict):
raise NotImplementedError
- getiterreversed = None # means no implementation is available
+ has_iterreversed = False
+ # no 'getiterreversed': no default implementation available
def rev_update1_dict_dict(self, w_dict, w_updatedict):
iteritems = self.iteritems(w_dict)
@@ -781,10 +782,11 @@
def iteritems(self, w_dict):
return IterClassItems(self.space, self, w_dict)
- if dictimpl.getiterreversed is not None:
+ if hasattr(dictimpl, 'getiterreversed'):
def iterreversed(self, w_dict):
return IterClassReversed(self.space, self, w_dict)
dictimpl.iterreversed = iterreversed
+ dictimpl.has_iterreversed = True
@jit.look_inside_iff(lambda self, w_dict, w_updatedict:
w_dict_unrolling_heuristic(w_dict))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit