Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r84674:23f580dcebd6 Date: 2016-05-24 18:58 -0700 http://bitbucket.org/pypy/pypy/changeset/23f580dcebd6/
Log: adjust per py3k and list/tuples now need hardcoding (grafted from bc1be9c89004d3d5a494648b8064a67793c49bcd) diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -1193,8 +1193,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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit