pydantic-settings
pydantic-settings copied to clipboard
when call Settings() the pyright report missing argument
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings3(BaseSettings):
model_config = SettingsConfigDict(cli_parse_args=True)
foobar: str = "default"
b: int # required
Settings3() # this line cause problem, pyright expect the b, but in basesetting this is valid.
pyright report error: Argument missing for parameter "b" (reportCallIssue)
Same code can pass mypy without issue.
I wonder if you know anything about why pyright behave like this, should we report a bug in their repo or is this some behavior debatable?