Summary
Classes in generated stubs are missing attributes if those attributes are not explicitly annotated at the class-level. The classic canonical, non-dataclass way of defining attributes in __init__(self, ...) is seemingly incompatible with stubgen.
Example
Input
class A:
def __init__(self, name: str) -> None:
self.name = name
Expected result
class A:
name: str
def __init__(self, name: str) -> None: ...
Actual result
class A:
def __init__(self, name: str) -> None: ...
Summary
Classes in generated stubs are missing attributes if those attributes are not explicitly annotated at the class-level. The classic canonical, non-dataclass way of defining attributes in
__init__(self, ...)is seemingly incompatible with stubgen.Example
Input
Expected result
Actual result