mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
merge 3.3 (#16722)
This commit is contained in:
commit
7643c92cdd
3 changed files with 37 additions and 5 deletions
|
@ -715,6 +715,12 @@ class BytesTest(BaseBytesTest):
|
|||
def __bytes__(self):
|
||||
return None
|
||||
self.assertRaises(TypeError, bytes, A())
|
||||
class A:
|
||||
def __bytes__(self):
|
||||
return b'a'
|
||||
def __index__(self):
|
||||
return 42
|
||||
self.assertEqual(bytes(A()), b'a')
|
||||
|
||||
# Test PyBytes_FromFormat()
|
||||
def test_from_format(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue