gh-100554: Add `Py_tp_vectorcall slot to set PyTypeObject.tp_vectorcall using the PyType_FromSpec` function family. (#123332)

This commit is contained in:
Wenzel Jakob 2024-09-14 00:40:25 +09:00 committed by GitHub
parent bbb36c0934
commit 74330d992b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 147 additions and 10 deletions

View file

@ -733,6 +733,14 @@ class CAPITest(unittest.TestCase):
with self.assertRaisesRegex(TypeError, msg):
sub = _testcapi.make_type_with_base(Base)
def test_heaptype_with_tp_vectorcall(self):
tp = _testcapi.HeapCTypeVectorcall
v0 = tp.__new__(tp)
v0.__init__()
v1 = tp()
self.assertEqual(v0.value, 2)
self.assertEqual(v1.value, 1)
def test_multiple_inheritance_ctypes_with_weakref_or_dict(self):
for weakref_cls in (_testcapi.HeapCTypeWithWeakref,
_testlimitedcapi.HeapCTypeWithRelativeWeakref):