ruff
1cb20127 - [ty] Add support for extra arguments in Pydantic model constructors (#26520)

Commit
17 days ago
[ty] Add support for extra arguments in Pydantic model constructors (#26520) ## Summary This is a first in a series of PRs to add dedicated support for Pydantic to ty. This PR sets up the main infrastructure for detecting Pydantic modules / classes using our `KnownModule`/`KnownClass` mechanism. It also (partially) implements a first feature of Pydantic support. By default[^1], Pydantic models accept extra arguments in their constructor: ```py class Person(BaseModel): name: str Person(name="Alice", something_else=7) # okay ``` closes https://github.com/astral-sh/ty/issues/3639 (This PR removes the false positive. I will track support for `extra="forbid"` and `__pydantic_extra__` separately) ## Test Plan - Updated Markdown tests - New tests around known module / class detection [^1]: That is, unless `extra="forbid"` is specified. We do not add support for this config setting here.
Author
Parents
Loading