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.
When extending BaseSettings, mypy complains with an error: Explicit "Any" is not allowed.
This is annoying because it means we have to add a type: ignore[misc] comment on all of our classes that use BaseSettings.
Related issue: #9373 regarding the BaseModel, that has already been fixed.
See the outcome of the issue you mentioned (the added note can be found at the end of the mypy plugin documentation).
Alternatively, we could switch to object instead in Any in the mypy plugin when we synthesize the __init__ methods. PR welcomed; this might break existing setups so we'll have to make sure this works as expected.
Initial Checks
Description
In my codebase, we ban the
Any
type using the--disallow-any-explicit
rule.When extending
BaseSettings
, mypy complains with an error:Explicit "Any" is not allowed
.This is annoying because it means we have to add a
type: ignore[misc]
comment on all of our classes that useBaseSettings
.Related issue: #9373 regarding the
BaseModel
, that has already been fixed.Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: