Document ty's @Todo type in the typing FAQ - #3847
Merged
Merged
Conversation
charliermarsh
marked this pull request as ready for review
June 24, 2026 12:39
@Todo type in the typing FAQ
sharkdp
approved these changes
Jun 24, 2026
Comment on lines
+57
to
+58
| ty itself. It may appear in type hints, `reveal_type()` output, or diagnostics. When an explanation | ||
| appears in parentheses, such as `@Todo(TypeVarTuple)`, it identifies the missing feature. |
Contributor
There was a problem hiding this comment.
That only works in debug mode, so users are unlikely to see this.
Suggested change
| ty itself. It may appear in type hints, `reveal_type()` output, or diagnostics. When an explanation | |
| appears in parentheses, such as `@Todo(TypeVarTuple)`, it identifies the missing feature. | |
| ty itself. It may appear in type hints, `reveal_type()` output, or diagnostics. |
charliermarsh
enabled auto-merge (squash)
June 24, 2026 13:54
charliermarsh
added a commit
to astral-sh/ruff
that referenced
this pull request
Jun 24, 2026
## Summary `@Todo` is a dynamic type that represents a known missing feature or incomplete implementation in ty, but it previously had no user-facing definition. As a result, go-to-type-definition on an inferred `@Todo` type returned no target, and users had no editor-visible explanation of what the type meant. This adds a documented `Todo` symbol to `ty_extensions` and routes all internal `@Todo` variants to that definition, following the existing `Divergent` pattern. Users can now command-click an inferred `@Todo` type to reach its documentation. `ty_extensions.Todo` remains an internal navigation target and is rejected in annotations. This complements astral-sh/ty#3847, which adds an FAQ entry. Closes astral-sh/ty#3209.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new FAQ entry explaining what
@Todomeans in ty's type system, how it differs fromAnyandUnknown, where it can appear, and why it cannot be used in annotations.This complements astral-sh/ruff#26324, which adds an editor navigation target for inferred
@Todotypes.Part of: #3209.