ruff/crates/ty_python_semantic/resources/mdtest
Douglas Creager b705664d49
[ty] Handle typevars that have other typevars as a default (#17956)
It's possible for a typevar to list another typevar as its default
value:

```py
class C[T, U = T]: ...
```

When specializing this class, if a type isn't provided for `U`, we would
previously use the default as-is, leaving an unspecialized `T` typevar
in the specialization. Instead, we want to use what `T` is mapped to as
the type of `U`.

```py
reveal_type(C())  # revealed: C[Unknown, Unknown]
reveal_type(C[int]())  # revealed: C[int, int]
reveal_type(C[int, str]())  # revealed: C[int, str]
```

This is especially important for the `slice` built-in type.
2025-05-08 19:01:27 -04:00
..
annotations Support typing.Self in methods (#17689) 2025-05-07 15:58:00 -07:00
assignment Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
binary [ty] Add missing bitwise-operator branches for boolean and integer arithmetic (#17949) 2025-05-08 14:10:35 +01:00
boolean Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
boundness_declaredness Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
call Support typing.Self in methods (#17689) 2025-05-07 15:58:00 -07:00
class Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
comparison Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
comprehensions Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
conditional Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
declaration Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
diagnostics [ty] Implement global handling and load-before-global-declaration syntax error (#17637) 2025-05-08 10:30:04 -04:00
directives Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
doc Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
exception Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
expression Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
function [ty] Recognise functions containing yield from expressions as being generator functions (#17930) 2025-05-07 23:29:44 +01:00
generics [ty] Handle typevars that have other typevars as a default (#17956) 2025-05-08 19:01:27 -04:00
import [ty] Support extending __all__ from an imported module even when the module is not an ExprName node (#17947) 2025-05-08 23:54:19 +01:00
literal Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
loops Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
narrow Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
regression Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
scopes [ty] Implement global handling and load-before-global-declaration syntax error (#17637) 2025-05-08 10:30:04 -04:00
shadowing Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
snapshots [ty] Make unused-ignore-comment disabled by default for now (#17955) 2025-05-08 17:21:34 +01:00
stubs Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
subscript Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
suppressions Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
type_of Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
type_properties [ty] Check base classes when determining subtyping etc for generic aliases (#17927) 2025-05-07 15:21:11 -04:00
type_qualifiers Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unary Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
with Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
.mdformat.toml Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
attributes.md [ty] Handle typevars that have other typevars as a default (#17956) 2025-05-08 19:01:27 -04:00
cycle.md [ty] add cycle handling for FunctionType::signature query (#17833) 2025-05-05 12:12:38 -07:00
dataclass_transform.md [ty] Detect overloads decorated with @dataclass_transform (#17835) 2025-05-07 15:51:13 +02:00
dataclasses.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
decorators.md [ty] Specialize bound methods and nominal instances (#17865) 2025-05-05 17:17:36 -04:00
descriptor_protocol.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
final.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
intersection_types.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
invalid_syntax.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
known_constants.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest_config.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mdtest_custom_typeshed.md [ty] Fix duplicate diagnostics for unresolved module when an import from statement imports multiple members (#17886) 2025-05-06 12:37:10 +01:00
metaclass.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
mro.md [ty] Respect the gradual guarantee when reporting errors in resolving MROs (#17962) 2025-05-08 22:57:39 +01:00
named_tuple.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
overloads.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
pep695_type_aliases.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
properties.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
protocols.md [ty] Report duplicate Protocol or Generic base classes with [duplicate-base], not [inconsistent-mro] (#17971) 2025-05-08 23:41:22 +01:00
slots.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
statically_known_branches.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
sys_platform.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
sys_version_info.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
terminal_statements.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
type_api.md Update class literal display to use <class 'Foo'> style (#17889) 2025-05-06 20:11:25 -04:00
typed_dict.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
union_types.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unpacking.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unreachable.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00