mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 22:55:08 +00:00
![]() ## Summary This PR adds a new `Type` variant called `TupleType` which is used for heterogeneous elements. ### Display notes * For an empty tuple, I'm using `tuple[()]` as described in the docs: https://docs.python.org/3/library/typing.html#annotating-tuples * For nested elements, it'll use the literal type instead of builtin type unlike Pyright which does `tuple[Literal[1], tuple[int, int]]` instead of `tuple[Literal[1], tuple[Literal[2], Literal[3]]]`. Also, mypy would give `tuple[builtins.int, builtins.int]` instead of `tuple[Literal[1], Literal[2]]` ## Test Plan Update test case to account for the display change and add cases for multiple elements and nested tuple elements. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Carl Meyer <carl@astral.sh> |
||
---|---|---|
.. | ||
src | ||
vendor/typeshed | ||
build.rs | ||
Cargo.toml | ||
README.md |
Red Knot
Semantic analysis for the red-knot project.
Vendored types for the stdlib
This crate vendors typeshed's stubs for the standard library. The vendored stubs can be found in crates/red_knot_python_semantic/vendor/typeshed
. The file crates/red_knot_python_semantic/vendor/typeshed/source_commit.txt
tells you the typeshed commit that our vendored stdlib stubs currently correspond to.
The typeshed stubs are updated every two weeks via an automated PR using the sync_typeshed.yaml
workflow in the .github/workflows
directory. This workflow can also be triggered at any time via workflow dispatch.