[ty] Allow partially stringified type[…] annotations by sharkdp · Pull Request #24518 · astral-sh/ruff (original) (raw)

@sharkdp added the ty

Multi-file analysis & type inference

label

Apr 9, 2026

sharkdp

sharkdp

sharkdp

sharkdp

@sharkdp

@sharkdp sharkdp marked this pull request as ready for review

April 9, 2026 12:22

AlexWaygood

@sharkdp

@sharkdp

AlexWaygood

AlexWaygood

@sharkdp

ibraheemdev pushed a commit that referenced this pull request

Apr 15, 2026

@sharkdp @ibraheemdev

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

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 }})