From 87d0b45485e1042b0eae8aedf98fa3ebb29846b8 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 3 Feb 2015 11:30:10 +0200 Subject: Issue #15381: Optimized io.BytesIO to make less allocations and copyings. --- Lib/test/test_memoryio.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Lib/test/test_memoryio.py') diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py index 24d282adc1..77749e78e8 100644 --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -718,12 +718,11 @@ class CBytesIOTest(PyBytesIOTest): @support.cpython_only def test_sizeof(self): - basesize = support.calcobjsize('P2nN2PnP') + basesize = support.calcobjsize('P2n2Pn') check = self.check_sizeof self.assertEqual(object.__sizeof__(io.BytesIO()), basesize) check(io.BytesIO(), basesize ) - check(io.BytesIO(b'a'), basesize + 1 ) - check(io.BytesIO(b'a' * 1000), basesize + 1000) + check(io.BytesIO(b'a' * 1000), basesize + sys.getsizeof(b'a' * 1000)) # Various tests of copy-on-write behaviour for BytesIO. -- cgit v1.2.1