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
cast also accept arguments like Optional[int] and Union[str, bytes] which are not of type Type but instead are of type builtins.object. Such an overload however is missing from the typeshed which only lists overloads for Type and str
The text was updated successfully, but these errors were encountered:
Mypy currently does not generate warnings for such usage of cast as it handles it in a way which apparently also seems to suppress this error. Manually creating a new method with the same signature as is currently provided for cast however leads to errors from mypy when using such a method in the same places as cast.
Thanks for pointing me towards that issue. The example given there is also how I stumbled upon this bug (implementing a cast-like function). Even if that proposal leads to something the signature for cast should be adjusted for current versions.
cast
also accept arguments likeOptional[int]
andUnion[str, bytes]
which are not of typeType
but instead are of typebuiltins.object
. Such an overload however is missing from the typeshed which only lists overloads forType
andstr
The text was updated successfully, but these errors were encountered: