pybind11-stubgen
pybind11-stubgen copied to clipboard
Avoid generating bad properties
Same problem as https://github.com/sizmailov/pybind11-stubgen/issues/33, but for properties instead!
@property
def m(self) -> std::mutex:
"""
:type: std::mutex
"""
Looking at it... it seems like one should do the ast.parse
trick in the PropertySignature
constructor. However, I'm not sure if you want to keep using those globals in FunctionSignature? Maybe it would make more sense to have some kind of validator class for storing all of those globals?
I agree, this is should be processed same way as other signatures. I consider this as a minor enchantment request (likewise #33) rather than a serious bug since it affects only modules with flawed bindings.
The library design is far from being perfect (initially was written in ~1 day as ad-hoc tool for my own use), I'm even considering complete rewrite as an option. Therefore suggested refactoring is a plausible way.
I think the issue was (finally) resolved with #112