ruff
239a6cba - [ty] Synthesize `__init__` for `TypedDict` (#24476)

Commit
1 day ago
[ty] Synthesize `__init__` for `TypedDict` (#24476) ## Summary <!-- What's the purpose of the change? What does it do, and why? --> This PR adds a synthesized `__init__` method for `TypedDict` that is used in server for hover. The new method is not used for type checking. The reason is that the current sophisticated validation logic has better UX than normal argument matching. The `__init__` method has two bindings right now: ``` class Movie(TypedDict): title: str year: int class Movie( __map: Movie, /, *, title: str = ..., year: int = ... ) class Movie( *, title: str = ..., year: int = ... ) ``` I removed the previous TODO to use synthesized method for type checking since this is being implemented with another solution. https://github.com/astral-sh/ruff/pull/24450. ## Test Plan <!-- How was it tested? --> --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Author
Parents
Loading