[pypy-commit] pypy py3.3: Change memoryview.suboffsets to be an empty tuple instead of None.

mjacob noreply at buildbot.pypy.org
Thu Feb 26 11:11:32 CET 2015


Author: Manuel Jacob <me at manueljacob.de>
Branch: py3.3
Changeset: r76153:b9de1d50ab49
Date: 2015-02-25 19:32 +0100
http://bitbucket.org/pypy/pypy/changeset/b9de1d50ab49/

Log:	Change memoryview.suboffsets to be an empty tuple instead of None.

diff --git a/pypy/objspace/std/memoryobject.py b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -144,7 +144,7 @@
     def w_get_suboffsets(self, space):
         self._check_released(space)
         # I've never seen anyone filling this field
-        return space.w_None
+        return space.newtuple([])
 
     def descr_repr(self, space):
         if self.buf is None:
diff --git a/pypy/objspace/std/test/test_memoryobject.py b/pypy/objspace/std/test/test_memoryobject.py
--- a/pypy/objspace/std/test/test_memoryobject.py
+++ b/pypy/objspace/std/test/test_memoryobject.py
@@ -44,7 +44,7 @@
 
     def test_suboffsets(self):
         v = memoryview(b"a"*100)
-        assert v.suboffsets == None
+        assert v.suboffsets == ()
 
     def test_compare(self):
         assert memoryview(b"abc") == b"abc"


More information about the pypy-commit mailing list