mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-113024: C API: Add PyObject_GenericHash() function (GH-113025)
This commit is contained in:
parent
567ab3bd15
commit
e2e0b4b4b9
14 changed files with 51 additions and 13 deletions
|
@ -1001,6 +1001,12 @@ class CAPITest(unittest.TestCase):
|
|||
self.assertTrue(number_check(0.5))
|
||||
self.assertFalse(number_check("1 + 1j"))
|
||||
|
||||
def test_object_generichash(self):
|
||||
# Test PyObject_GenericHash()
|
||||
generichash = _testcapi.object_generichash
|
||||
for obj in object(), 1, 'string', []:
|
||||
self.assertEqual(generichash(obj), object.__hash__(obj))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue