pybind11-stubgen icon indicating copy to clipboard operation
pybind11-stubgen copied to clipboard

Avoid generating bad properties

Open virtuald opened this issue 3 years ago • 1 comments

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?

virtuald avatar Sep 06 '20 05:09 virtuald

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.

sizmailov avatar Sep 08 '20 06:09 sizmailov

I think the issue was (finally) resolved with #112

sizmailov avatar Aug 29 '23 13:08 sizmailov