mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 21:40:51 -05:00
Add support for the `typing.reveal_type` function, emitting a diagnostic revealing the type of its single argument. This is a necessary piece for the planned testing framework. This puts the cart slightly in front of the horse, in that we don't yet have proper support for validating call signatures / argument types. But it's easy to do just enough to make `reveal_type` work. This PR includes support for calling union types (this is necessary because we don't yet support `sys.version_info` checks, so `typing.reveal_type` itself is a union type), plus some nice consolidated error messages for calls to unions where some elements are not callable. This is mostly to demonstrate the flexibility in diagnostics that we get from the `CallOutcome` enum.
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.