ruff/crates/red_knot_workspace
Carl Meyer 645ce7e5ec
[red-knot] infer types for PEP695 typevars (#14182)
## Summary

Create definitions and infer types for PEP 695 type variables.

This just gives us the type of the type variable itself (the type of `T`
as a runtime object in the body of `def f[T](): ...`), with special
handling for its attributes `__name__`, `__bound__`, `__constraints__`,
and `__default__`. Mostly the support for these attributes exists
because it is easy to implement and allows testing that we are
internally representing the typevar correctly.

This PR doesn't yet have support for interpreting a typevar as a type
annotation, which is of course the primary use of a typevar. But the
information we store in the typevar's type in this PR gives us
everything we need to handle it correctly in a future PR when the
typevar appears in an annotation.

## Test Plan

Added mdtest.
2024-11-08 21:23:05 +00:00
..
resources/test/corpus [red-knot] infer types for PEP695 typevars (#14182) 2024-11-08 21:23:05 +00:00
src Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
tests [red-knot] Infer target types for unpacked tuple assignment (#13316) 2024-10-15 19:07:11 +00:00
Cargo.toml Rename the ruff_vendored crate to red_knot_vendored (#13586) 2024-10-01 16:16:59 +01:00