Skip to content

Commit 577c05f

Browse files
authored
Add note about Mypy plugin for BaseSettings.__init__() (#842)
1 parent 2355bc5 commit 577c05f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pydantic_settings/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ class BaseSettings(BaseModel):
174174
Defaults to `None`.
175175
"""
176176

177+
# Note: when adding new parameters, make sure to use `object` instead of `Any` to avoid issues with the Mypy plugin
178+
# when used with `--disallow-any-explicit`. If `Any` needs to be used as a generic parameter for variance (e.g. in `_build_sources`),
179+
# make sure to update the Pydantic Mypy plugin accordingly.
177180
def __init__(
178181
__pydantic_self__,
179182
_case_sensitive: bool | None = None,

0 commit comments

Comments
 (0)