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
Since typing.Any matches literally anything, for @overload that start with special cases these are always picked in untyped code. Instead, @overload should prefer the most generic, conservative case.
This is related to and got my attention by the pandas concat type hints bug that causes Any -> ??? paths to select None -> Never overloads.
Minimal Reproducible Example
# Type test# MyPy "correctly" reports the unused type ignoreasyncdeftest_filter_any(aitr: "AsyncIterator[int | None]") ->None:
filter_any: Any= ... # < we don't know the actual type and don't careasyncforitemina.filter(filter_any, aitr):
print(2+item) # type: ignore
Request Assignment [Optional]
I already understand the cause and want to submit a bugfix.
The text was updated successfully, but these errors were encountered:
What happened?
Since
typing.Any
matches literally anything, for@overload
that start with special cases these are always picked in untyped code. Instead,@overload
should prefer the most generic, conservative case.This is related to and got my attention by the pandas concat type hints bug that causes
Any -> ???
paths to selectNone -> Never
overloads.Minimal Reproducible Example
Request Assignment [Optional]
The text was updated successfully, but these errors were encountered: