【Pybind11】:没有正确判断静态成员变量,自然也没有正确处理相关转换
class Pybind11DefaultStaticMemberVariableTranslator(
common_translators.DefaultMemberVariableTranslator
):
...
def condition(self, member_variable: cursors.MemberVariable) -> bool:
return (
super().condition(member_variable)
and member_variable.is_public
and member_variable.is_static
)
这并不能正确判断静态成员变量。
pybind11静态成员变量转换实现:https://pybind11.readthedocs.io/en/stable/classes.html?highlight=def_readwrite_static#instance-and-static-fields
Edited by chenyang.wang