There was an error while loading. Please reload this page.
1 parent f118655 commit 5bfab66Copy full SHA for 5bfab66
1 file changed
Lib/test/test_bytes.py
@@ -1438,6 +1438,13 @@ class SubBytes(bytes):
1438
self.assertNotEqual(id(s), id(1 * s))
1439
self.assertNotEqual(id(s), id(s * 2))
1440
1441
+ @support.cpython_only
1442
+ def test_repeat_singleton(self):
1443
+ for b in b'', b'x', b"abc":
1444
+ for repeat in (0, -23):
1445
+ self.assertIs(b * repeat, b'')
1446
+ self.assertIs(self.type2test(b) * repeat, b'')
1447
+
1448
1449
class ByteArrayTest(BaseBytesTest, unittest.TestCase):
1450
type2test = bytearray
0 commit comments