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
I’m getting this mypy error on responses argument:
Argument "responses" to "put" of "APIRouter" has incompatible type "Dict[int, Dict[str, Type[Message]]]"; expected "Optional[Dict[Union[int, str], Dict[str, Any]]]"
When I change the argument to responses={**responses}, the error is still there, albeit a little bit different:
List item 0 has incompatible type "Dict[int, Dict[str, Type[Message]]]"; expected "Mapping[Union[int, str], Dict[str, Any]]"
Does anyone know why this is happening?
The text was updated successfully, but these errors were encountered:
I would assume that mypy cannot derive the type of your dictionary the way you want it to, which leads to this obscure error. Consider adding an annotation:
Following the example from the additional responses guide:
I’m getting this mypy error on
responses
argument:When I change the argument to
responses={**responses}
, the error is still there, albeit a little bit different:Does anyone know why this is happening?
The text was updated successfully, but these errors were encountered: