mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #1303: Adapt str8 constructor to bytes (now buffer) one.
This commit is contained in:
parent
97f9d4f312
commit
bd1c68c94f
15 changed files with 212 additions and 72 deletions
|
@ -580,7 +580,8 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertEqual(hash(1), hash(1))
|
||||
self.assertEqual(hash(1), hash(1.0))
|
||||
hash('spam')
|
||||
self.assertEqual(hash('spam'), hash(str8('spam')))
|
||||
self.assertEqual(hash('spam'), hash(str8(b'spam'))) # remove str8()
|
||||
# when b"" is immutable
|
||||
hash((0,1,2,3))
|
||||
def f(): pass
|
||||
self.assertRaises(TypeError, hash, [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue