Skip to content

Commit

Permalink
Avoid using Any in BaseSettings signature to avoid mypy errors (#529
Browse files Browse the repository at this point in the history
)

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
  • Loading branch information
Viicos and hramezani authored Feb 19, 2025
1 parent ccf99b2 commit 537f751
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pydantic_settings/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ class BaseSettings(BaseModel):
"""

def __init__(
__pydantic_self__,
self,
/,
_case_sensitive: bool | None = None,
_nested_model_default_partial_update: bool | None = None,
_env_prefix: str | None = None,
Expand All @@ -155,7 +156,7 @@ def __init__(
_env_parse_enums: bool | None = None,
_cli_prog_name: str | None = None,
_cli_parse_args: bool | list[str] | tuple[str, ...] | None = None,
_cli_settings_source: CliSettingsSource[Any] | None = None,
_cli_settings_source: CliSettingsSource[object] | None = None,
_cli_parse_none_str: str | None = None,
_cli_hide_none_type: bool | None = None,
_cli_avoid_json: bool | None = None,
Expand All @@ -170,9 +171,8 @@ def __init__(
_secrets_dir: PathType | None = None,
**values: Any,
) -> None:
# Uses something other than `self` the first arg to allow "self" as a settable attribute
super().__init__(
**__pydantic_self__._settings_build_values(
**self._settings_build_values(
values,
_case_sensitive=_case_sensitive,
_nested_model_default_partial_update=_nested_model_default_partial_update,
Expand Down

0 comments on commit 537f751

Please sign in to comment.