summaryrefslogtreecommitdiff
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-08-15 17:49:46 +0200
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-15 08:49:46 -0700
commit37806f404f57b234902f0c8de9a04647ad01b7f1 (patch)
tree9d78c5a0256784d19987b3a9fc72367d336da9fd /Objects/typeobject.c
parent40dad9545aad4ede89abbab1c1beef5303d9573e (diff)
downloadcpython-git-37806f404f57b234902f0c8de9a04647ad01b7f1.tar.gz
bpo-37207: enable vectorcall for type.__call__ (GH-14588)
Base PR for other PRs that want to play with `type.__call__` such as #13930 and #14589. The author is really @markshannon I just made the PR. https://bugs.python.org/issue37207 Automerge-Triggered-By: @encukou
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 9e5709a74f..0ca7dcb695 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3614,7 +3614,7 @@ PyTypeObject PyType_Type = {
sizeof(PyHeapTypeObject), /* tp_basicsize */
sizeof(PyMemberDef), /* tp_itemsize */
(destructor)type_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
+ offsetof(PyTypeObject, tp_vectorcall), /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
@@ -3629,7 +3629,8 @@ PyTypeObject PyType_Type = {
(setattrofunc)type_setattro, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_BASETYPE | Py_TPFLAGS_TYPE_SUBCLASS, /* tp_flags */
+ Py_TPFLAGS_BASETYPE | Py_TPFLAGS_TYPE_SUBCLASS |
+ _Py_TPFLAGS_HAVE_VECTORCALL, /* tp_flags */
type_doc, /* tp_doc */
(traverseproc)type_traverse, /* tp_traverse */
(inquiry)type_clear, /* tp_clear */