mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Breaking ground for PEP 3137 implementation:
Get rid of buffer(). Use memoryview() in its place where possible. In a few places, do things a bit different, because memoryview() can't slice (yet).
This commit is contained in:
parent
85c1ba5d74
commit
bae07c9baf
24 changed files with 72 additions and 199 deletions
|
@ -251,7 +251,7 @@ class IOTest(unittest.TestCase):
|
|||
|
||||
def test_array_writes(self):
|
||||
a = array.array('i', range(10))
|
||||
n = len(buffer(a))
|
||||
n = len(memoryview(a))
|
||||
f = io.open(test_support.TESTFN, "wb", 0)
|
||||
self.assertEqual(f.write(a), n)
|
||||
f.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue