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
The snippet above does type-check with 4.3.0, where Draft7Validator was annotated as Any. The change was made in #7025 .
Are we misunderstanding or misusing Draft7Validator - is it not expected to be a type like this? If not, perhaps this is a problem in mypy rather than the stubs?
For what it's worth: mypy's documentation suggests that tp: Type[_Validator] is considered a "variable of type _Validator". Perhaps mypy's complaint is that tp's value could be a replaced with a different subtype of _Validator at runtime? With that in mind, I tried patching the stubs to read Draft7Validator: Final[type[_Validator]] but this didn't seem to appease the type gods.