ruff/crates/red_knot_python_semantic/resources/mdtest
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
..
annotations [red-knot] Store starred-expression annotation types (#14106) 2024-11-05 20:25:45 +01:00
assignment [red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
binary [red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
boolean [red-knot] Remove Type::Unbound (#13980) 2024-10-31 20:05:53 +01:00
call [red-knot] Improve Symbol API for callable types (#14137) 2024-11-07 19:58:31 +01:00
comparison [red-knot] Type inference for comparisons involving intersection types (#14138) 2024-11-07 20:51:14 +01:00
conditional [red-knot] Remove Type::Unbound (#13980) 2024-10-31 20:05:53 +01:00
declaration [red-knot] Remove lint-phase (#13922) 2024-10-25 18:40:52 +00:00
exception Add mdtest support for files with invalid syntax (#14126) 2024-11-06 12:25:52 +01:00
expression [red-knot] Infer type of if-expression if test has statically known truthiness (#14048) 2024-11-01 12:23:18 -07:00
import [red-knot] Remove Type::Unbound (#13980) 2024-10-31 20:05:53 +01:00
literal [red-knot] Literal special form (#13874) 2024-11-05 01:45:46 +00:00
loops [red-knot] Improve Symbol API for callable types (#14137) 2024-11-07 19:58:31 +01:00
narrow [red-knot] Add narrowing for issubclass checks (#14128) 2024-11-07 14:15:39 +01:00
scopes Add support for resolving metaclasses (#14120) 2024-11-06 15:41:35 -05:00
shadowing [red-knot] have mdformat wrap mdtest files to 100 columns (#14020) 2024-10-31 21:00:51 +00:00
stubs [red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
subscript [red-knot] Infer type of if-expression if test has statically known truthiness (#14048) 2024-11-01 12:23:18 -07:00
unary [red-knot] Literal special form (#13874) 2024-11-05 01:45:46 +00:00
with [red-knot] have mdformat wrap mdtest files to 100 columns (#14020) 2024-10-31 21:00:51 +00:00
.mdformat.toml [red-knot] have mdformat wrap mdtest files to 100 columns (#14020) 2024-10-31 21:00:51 +00:00
attributes.md [red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
generics.md [red-knot] infer types for PEP695 typevars (#14182) 2024-11-08 21:23:05 +00:00
metaclass.md [red-knot] Improve error message for metaclass conflict (#14174) 2024-11-08 11:58:57 +00:00
mro.md [red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
unpacking.md Fix duplicate unpack diagnostics (#14125) 2024-11-06 11:28:29 +00:00