mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
gh-100554: Add `Py_tp_vectorcall slot to set PyTypeObject.tp_vectorcall using the PyType_FromSpec` function family. (#123332)
This commit is contained in:
parent
bbb36c0934
commit
74330d992b
8 changed files with 147 additions and 10 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue