bpo-24234: Implement bytes.__bytes__ (GH-27901)

This commit is contained in:
Dong-hee Na 2021-08-23 10:01:51 +00:00 committed by GitHub
parent 6082bb5add
commit 24b63c695a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 3 deletions

View file

@ -1543,11 +1543,11 @@ class ProtocolTests(BaseTestCase):
def test_supports_bytes(self):
# Note: bytes itself doesn't have __bytes__.
class B:
def __bytes__(self):
return b''
self.assertIsSubclass(bytes, typing.SupportsBytes)
self.assertIsSubclass(B, typing.SupportsBytes)
self.assertNotIsSubclass(str, typing.SupportsBytes)