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
Please provide more information to help us understand the issue:
Are you reporting a bug, or opening a feature request?
A bug (potentially) in Stubgen
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
I am using stubgen to generate ".pyi" file.
Original Python Source Code for this "Car" class is:
What are the versions of mypy and Python you are using?
Do you see the same issue after installing mypy from Git master?
mypy 0.620
python 3.7.0
(I have not tried out mypy from Git master)
What are the mypy flags you are using? (For example --strict-optional)
N/A
If mypy crashed with a traceback, please paste
the full traceback below.
N/A
If there is a workaround to code this "Car" class in a different variant, which retains TypeHint during Stubgen, please let me know also.
Thanks.
The text was updated successfully, but these errors were encountered:
@JukkaL
Actually this (preserving explicit annotations) was implemented in #3169, but it looks like the implementation has an inconsistency (bug?): it works correctly when an attribute is declared in the class body, but doesn't work if it was declared in __init__.
Should we reopen this for tracking preserving explicit annotations, and keep #3475 for inferred, or you want to have the latter for both?
Please provide more information to help us understand the issue:
Are you reporting a bug, or opening a feature request?
A bug (potentially) in Stubgen
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
I am using stubgen to generate ".pyi" file.
Original Python Source Code for this "Car" class is:
I expect the type hint of those member variables would be retained instead of using "Any".
e.g.
What are the versions of mypy and Python you are using?
Do you see the same issue after installing mypy from Git master?
mypy 0.620
python 3.7.0
(I have not tried out mypy from Git master)
What are the mypy flags you are using? (For example --strict-optional)
N/A
If mypy crashed with a traceback, please paste
the full traceback below.
N/A
If there is a workaround to code this "Car" class in a different variant, which retains TypeHint during Stubgen, please let me know also.
Thanks.
The text was updated successfully, but these errors were encountered: