[ty] Allow partially stringified type[…] annotations by sharkdp · Pull Request #24518 · astral-sh/ruff (original) (raw)
added the ty
Multi-file analysis & type inference
label
sharkdp marked this pull request as ready for review
ibraheemdev pushed a commit that referenced this pull request
Summary
Allow partially stringified type["ForwardRef"] annotations, even if
they are not explicitly allowed by the typing spec. The implementation
here follows what we do in e.g. infer_string_type_expression.
closes astral-sh/ty#3244
Ecosystem
We apparently get rid of a prevalent @Todo type, so we see new
diagnostics, but nothing that looks like new false positives, related
to this change. A lot of ecosystem hits have an ignore-comment for
another type checker, which is generally a good signal.
Test Plan
- New Markdown tests
- Verified that it fixes the problem in astral-sh/ty#3244
This was referenced
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})