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
$ py -m mypy .
my.py:4: error: List item 0 has incompatible type "list[Any]"; expected "float" [list-item]
my.py:4: error: List item 1 has incompatible type "list[Any]"; expected "float" [list-item]
my.py:4: error: List item 2 has incompatible type "list[Any]"; expected "float" [list-item]
Found 3 errors in 1 file (checked 1 source file)
Hi!
I have a bug with mypy when dealing with
Gf.Vec3f
type.What's happening
If you write this code:
You'll get these errors:
The same happens with Vec3h, Vec2f, Vec3i, etc...
Expected behavior
mypy should not raise errors.
Reason
The issue (for Vec3f) comes from
usd/stubs/pxr/Gf/__init__.pyi
at lines lines 6715 to 6720:Both
__getitem__
methods have the exact same signature (i.e.(self, int)
) but return different types:list
andfloat
Workaround
Add
# type: ignore [list-item]
at the end of the line with the errorThe text was updated successfully, but these errors were encountered: