[pypy-commit] pypy py3k-osxfix: adjust per py3k and list/tuples now need hardcoding

pjenvey pypy.commits at gmail.com
Tue May 24 21:59:41 EDT 2016


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k-osxfix
Changeset: r84673:bc1be9c89004
Date: 2016-05-24 18:58 -0700
http://bitbucket.org/pypy/pypy/changeset/bc1be9c89004/

Log:	adjust per py3k and list/tuples now need hardcoding

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1196,8 +1196,7 @@
         elif flag == 'S':
             return False
         else:
-            return (self.lookup(w_obj, '__getitem__') is not None and
-                    self.lookup(w_obj, '__getslice__') is None)
+            return self.lookup(w_obj, '__getitem__') is not None
 
     # The code below only works
     # for the simple case (new-style instance).
diff --git a/pypy/module/cpyext/test/test_mapping.py b/pypy/module/cpyext/test/test_mapping.py
--- a/pypy/module/cpyext/test/test_mapping.py
+++ b/pypy/module/cpyext/test/test_mapping.py
@@ -5,6 +5,7 @@
     def test_check(self, space, api):
         assert api.PyMapping_Check(space.newdict())
         assert not api.PyMapping_Check(space.newlist([]))
+        assert not api.PyMapping_Check(space.newtuple([]))
 
     def test_size(self, space, api):
         w_d = space.newdict()
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -90,6 +90,8 @@
             setattr(self, 'w_' + typedef.name, w_type)
             self._interplevel_classes[w_type] = cls
         self.w_dict.flag_map_or_seq = 'M'
+        self.w_list.flag_map_or_seq = 'S'
+        self.w_tuple.flag_map_or_seq = 'S'
         self.w_unicode = self.w_str
         self.w_text = self.w_str
         self.w_str = self.w_bytes


More information about the pypy-commit mailing list