mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.
This commit is contained in:
parent
9de7efe5ab
commit
ea36c941a1
6 changed files with 56 additions and 21 deletions
|
@ -314,6 +314,10 @@ class BoolTest(unittest.TestCase):
|
|||
return -1
|
||||
self.assertRaises(ValueError, bool, Eggs())
|
||||
|
||||
def test_from_bytes(self):
|
||||
self.assertIs(bool.from_bytes(b'\x00'*8, 'big'), False)
|
||||
self.assertIs(bool.from_bytes(b'abcd', 'little'), True)
|
||||
|
||||
def test_sane_len(self):
|
||||
# this test just tests our assumptions about __len__
|
||||
# this will start failing if __len__ changes assertions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue