mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
![]() You can now use subscript expressions in a type expression to explicitly specialize generic classes, just like you could already do in value expressions. This still does not implement bidirectional checking, so a type annotation on an assignment does not influence how we infer a specialization for a (not explicitly specialized) constructor call. You might get an `invalid-assignment` error if (a) we cannot infer a class specialization from the constructor call (in which case you end up e.g. trying to assign `C[Unknown]` to `C[int]`) or if (b) we can infer a specialization, but it doesn't match the annotation. Closes https://github.com/astral-sh/ruff/issues/17432 |
||
---|---|---|
.. | ||
annotations.md | ||
augmented.md | ||
multi_target.md | ||
unbound.md | ||
walrus.md |