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
in my codebase, we ban the Any type using the --disallow-any-explicit rule (along with all the other rules that ban Any in other contexts). when extending BaseModel, mypy complains with a no-any-explicit error.
this is annoying because it means we have to add a type:ignore comment on all of our classes that use BaseModel.
related issue: the dataclass decorator had the same problem (#4355), which i fixed in #4356. but i can't seem to figure out what's causing it in this case. i think it may be related to the pydantic mypy plugin?
Example Code
frompydanticimportBaseModelclassFoo(BaseModel): # error: Explicit "Any" is not allowed (no-any-explicit)
...
Initial Checks
Description
in my codebase, we ban the
Any
type using the--disallow-any-explicit
rule (along with all the other rules that banAny
in other contexts). when extendingBaseModel
, mypy complains with ano-any-explicit
error.this is annoying because it means we have to add a
type:ignore
comment on all of our classes that useBaseModel
.related issue: the
dataclass
decorator had the same problem (#4355), which i fixed in #4356. but i can't seem to figure out what's causing it in this case. i think it may be related to the pydantic mypy plugin?Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: