[ty] Add failing tests for tuple subclasses#19803
Merged
AlexWaygood merged 2 commits intomainfrom Aug 7, 2025
Merged
Conversation
dcreager
approved these changes
Aug 7, 2025
|
|
||
| ```toml | ||
| [environment] | ||
| python-version = "3.11" |
Member
There was a problem hiding this comment.
Out of curiosity, which part needs 3.11?
Member
Author
There was a problem hiding this comment.
t2: tuple[int, *tuple[str, ...]] is invalid syntax on Python <=3.10 -- starred elements are never allowed in annotations on older versions of Python. On Python <=3.10, you would have to use t1: tuple[int, Unpack[tuple[str, ...]]] (because there's no backwards compatibility problem that can't be solved with more "bracketese"!!) to express this type, but we don't support Unpack yet
Member
There was a problem hiding this comment.
Starred tuples, yes! That paged out of my memory quickly 😬
Co-authored-by: Douglas Creager <[email protected]>
dcreager
added a commit
that referenced
this pull request
Aug 7, 2025
dcreager
added a commit
that referenced
this pull request
Aug 7, 2025
* dcreager/bound-typevar: (24 commits) more comment fix this isn't true anymore fix inner function in overload implementation ecosystem error Update Rust toolchain to 1.89 (#19807) [ty] Add `ty.inlayHints.variableTypes` server option (#19780) synthetic typevars for type materializations are bound [ty] Add failing tests for tuple subclasses (#19803) [ty] Add `ty.experimental.rename` server setting (#19800) clippy make BoundTypeVarInstance interned [ty] Implemented support for "rename" language server feature (#19551) [ty] Reduce size of member table (#19572) [ty] Move server capabilities creation (#19798) separate types! tmp allow KnownInstance::TypeVar in type expressions bind typevar in Generic/Protocol base class reference [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793) remove unneeded GenericContext::with_binding_context create KnownInstanceType::TypeVar for PEP 695 too ...
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
This PR adds tests for tuple subclasses. The tests nearly all fail for now (there are many TODO comments added!) but #19669 makes them pass.
I'm extracting the tests into a standalone PR to make #19669 easier to review.
Test Plan
cargo test -p ty_python_semantic