You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the attributes are wrong.
When I do
@attr.s(auto_attribs = True)
class Dummy:
var: str
and run stubgen against it.
The stub I get looks like
def __init__(self)->None
I expect
def __init__(self, var: str)->None
If I do
@attr.s()
class Dummy:
var: str = attr.ib()
var2 = attr.ib(type:str)
I get closer to the expected output, but it is missing the type information
def __init__(self, var: Any, var2: Any)->None
The text was updated successfully, but these errors were encountered:
Hm, this looks like a bug. But maybe a better behavior would be to preserve the class decorator completely, since attrs are treated in quite special way by mypy.
When I generate stubs using mypy's stubgen I find that I am forced to use the attrib = attr.ib(...) to get the stub for init to have the attributes in them. Even then the typing information for the attributes are wrong.
When I do
and run stubgen against it.
The stub I get looks like
I expect
If I do
I get closer to the expected output, but it is missing the type information
The text was updated successfully, but these errors were encountered: