mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
repr(b"\0") should return b"\x00", not the (unusual) b"\0".
This commit is contained in:
parent
e5e80b8c56
commit
57b93ad56d
2 changed files with 4 additions and 3 deletions
|
@ -73,8 +73,9 @@ class BytesTest(unittest.TestCase):
|
|||
|
||||
def test_repr(self):
|
||||
self.assertEqual(repr(bytes()), "b''")
|
||||
self.assertEqual(repr(bytes([0])), "b'\\0'")
|
||||
self.assertEqual(repr(bytes([0, 1, 254, 255])), "b'\\0\\x01\\xfe\\xff'")
|
||||
self.assertEqual(repr(bytes([0])), "b'\\x00'")
|
||||
self.assertEqual(repr(bytes([0, 1, 254, 255])),
|
||||
"b'\\x00\\x01\\xfe\\xff'")
|
||||
self.assertEqual(repr(bytes('abc')), "b'abc'")
|
||||
self.assertEqual(repr(bytes("'")), "b'\\''")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue