To Reproduce
https://mypy-play.net/?mypy=latest&python=3.10&flags=strict%2Cwarn-redundant-casts&gist=bc9999020b0fb32610c0c3ec99a8568c
fromtypingimportProtocol, castclassFooType(Protocol):
def__call__(self, ham: str) ->str:
passdeffoo(ham: str) ->str:
passv=cast(FooType, foo)
u: FooType=foo
Expected Behavior
I was expecting v = cast(FooType, foo) to work about the same as v: FooType = foo # type: ignore[assignment] with warn redundant ignores
Your Environment
See mypy-play
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.10&flags=strict%2Cwarn-redundant-casts&gist=bc9999020b0fb32610c0c3ec99a8568c
Expected Behavior
I was expecting
v = cast(FooType, foo)to work about the same asv: FooType = foo # type: ignore[assignment]with warn redundant ignoresYour Environment
See mypy-play