-
Notifications
You must be signed in to change notification settings - Fork 7k
Missing type hints cause falsely detected return type #8829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Any chance to get the pr merged soon? |
Thanks for the report @twsl - Just pasting my comment from #8830 (comment)
|
@NicolasHug I really don't understand your comment tho, cause this would help dealing with mypy, regardless of other type-checkers, as the current implementation is lacking all type hints. |
I wish it would be that simple, but it's not. Some type checkers are happy with some annotations, while others are not. For example, mypy fails on your PR: https://github.com/pytorch/vision/actions/runs/13437322523/job/37542714033?pr=8830 I'm really sorry, but I have no bandwidth to deal with different type checkers. In fact I don't recommend rely on torchvision's type annotations at all, because a lot of them are wrong. They exist for torchscript to work, but they are often pretty incorrect. |
Well, I do understand and share your frustration with mypy. However, given that my PR provides the correct implementation of the typehints and they are valuable for torchscript and other causes, i think we should still strive to merge it. I'll try to figure out, if mypy's wrong behaviour can be fixed and hope you will reconsider then (edit: at least it passes now) |
🐛 Describe the bug
The return type is automatically assumed as
BoundingBoxes | Any
by pyrightvision/torchvision/tv_tensors/__init__.py
Lines 14 to 15 in d3beb52
This could easily be fixed
Versions
The text was updated successfully, but these errors were encountered: