I tested it on a private project using pybind11 to bind python extensions and pybind11_stubgen to generate stubs, but I can't show those codes, so I added an simple testing example, for convenience I just use a module written in python instead of a pybind11 module.
class Vector:
pass
Vector3f = Vector
It will generate stub as follows:
from __future__ import annotations
import test_alias_class
import typing
__all__ = [
"Vector",
"Vector3f"
]
class Vector():
pass
Vector3f = Vector
Test result on current master brunch:
from __future__ import annotations
import test_alias_class
import typing
__all__ = [
"Vector",
"Vector3f"
]
class Vector():
pass
class Vector():
pass
I saw the same issue on https://github.com/sizmailov/pybind11-stubgen/pull/63, but it was not merged?Recently I faced the same problem and I solved it.
I tested it on a private project using pybind11 to bind python extensions and pybind11_stubgen to generate stubs, but I can't show those codes, so I added an simple testing example, for convenience I just use a module written in python instead of a pybind11 module.
It will generate stub as follows:
Test result on current master brunch: