mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 01:36:21 +00:00
Fix dynamic attribute inheritance in C++
`PyType_Ready` would usually perform the inheritance for us, but it can't adjust `tp_basicsize` appropriately.
This commit is contained in:
@@ -179,6 +179,9 @@ struct type_record {
|
||||
|
||||
bases.append((PyObject *) base_info->type);
|
||||
|
||||
if (base_info->type->tp_dictoffset != 0)
|
||||
dynamic_attr = true;
|
||||
|
||||
if (caster)
|
||||
base_info->implicit_casts.push_back(std::make_pair(type, caster));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user