We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d1d32e commit d930755Copy full SHA for d930755
include/pybind11/detail/internal_pytypes.h
@@ -208,7 +208,11 @@ struct pybind_function_type_data {
208
209
set_vectorcall_set_offset(type, offsetof(pybind_function, vectorcall));
210
211
- type.tp_flags = Py_TPFLAGS_METHOD_DESCRIPTOR | Py_TPFLAGS_DEFAULT | pybind_vectorcall_flag;
+ type.tp_flags = Py_TPFLAGS_DEFAULT | pybind_vectorcall_flag;
212
+
213
+#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
214
+ type.tp_flags |= Py_TPFLAGS_METHOD_DESCRIPTOR;
215
+#endif
216
217
type.tp_descr_get = [](PyObject *self, PyObject *obj, PyObject *) -> PyObject * {
218
// std::cout << "Ideally shouldn't be calling tp_descr_get ... " << obj << std::endl;
0 commit comments