diff options
author | Wenzel Jakob <wenzel.jakob@epfl.ch> | 2024-09-13 15:40:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 15:40:25 (GMT) |
commit | 74330d992be26829dba65ab83d698d42b2f2a2ee (patch) | |
tree | 2463c9d5871d5057df1cf7e81eabfc268cf43fab /Lib/test/test_capi | |
parent | bbb36c0934b7644a9f8b67d3cae78aa6240e005a (diff) | |
download | cpython-74330d992be26829dba65ab83d698d42b2f2a2ee.zip cpython-74330d992be26829dba65ab83d698d42b2f2a2ee.tar.gz cpython-74330d992be26829dba65ab83d698d42b2f2a2ee.tar.bz2 |
gh-100554: Add ``Py_tp_vectorcall`` slot to set ``PyTypeObject.tp_vectorcall`` using the ``PyType_FromSpec`` function family. (#123332)
Diffstat (limited to 'Lib/test/test_capi')
-rw-r--r-- | Lib/test/test_capi/test_misc.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index 18392c4..ebc0a8a 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -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): |