[pypy-commit] pypy py3.3: Simplify code and make it correctly respect the w_ convention.

mjacob pypy.commits at gmail.com
Sat Feb 13 09:14:17 EST 2016


Author: Manuel Jacob <me at manueljacob.de>
Branch: py3.3
Changeset: r82214:3f20320bc330
Date: 2016-02-13 15:12 +0100
http://bitbucket.org/pypy/pypy/changeset/3f20320bc330/

Log:	Simplify code and make it correctly respect the w_ convention.

diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -66,10 +66,10 @@
         # overwrite the value of a key already in w_initialdict. (So as to avoid
         # overriding the builtin value with a user-provided value)
         if not self.space.is_none(self.w_initialdict):
-            w_items = self.space.iteriterable(self.space.call_method(self.w_dict,'items'))
-            for w_item in w_items:
+            w_items = self.space.call_method(self.w_dict, 'items')
+            for w_item in self.space.iteriterable(w_items):
                 w_key, w_value = self.space.fixedview(w_item, expected_length=2)
-                if not self.space.is_true(self.space.contains(self.w_initialdict, w_key)):
+                if not self.space.contains_w(self.w_initialdict, w_key):
                     self.space.setitem(self.w_initialdict, w_key, w_value)
         else:
             self.w_initialdict = self.space.call_method(self.w_dict, 'copy')


More information about the pypy-commit mailing list