ruff/crates/ty_python_semantic/resources/mdtest
Douglas Creager 47e3aa40b3
[ty] Specialize bound methods and nominal instances (#17865)
Fixes
https://github.com/astral-sh/ruff/pull/17832#issuecomment-2851224968. We
had a comment that we did not need to apply specializations to generic
aliases, or to the bound `self` of a bound method, because they were
already specialized. But they might be specialized with a type variable,
which _does_ need to be specialized, in the case of a "multi-step"
specialization, such as:

```py
class LinkedList[T]: ...

class C[U]:
    def method(self) -> LinkedList[U]:
        return LinkedList[U]()
```

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-05-05 17:17:36 -04:00
..
annotations Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
assignment Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
binary Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
boolean Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
boundness_declaredness Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
call Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
class Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 [semantic-syntax-tests] for for InvalidStarExpression, DuplicateMatchKey, and DuplicateMatchClassAttribute (#17754) 2025-05-05 17:30:16 +00: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
expression Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
function Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
generics [ty] Specialize bound methods and nominal instances (#17865) 2025-05-05 17:17:36 -04:00
import Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
regression Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
scopes Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
shadowing Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
snapshots Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
stubs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
subscript Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
suppressions Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
type_of Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
type_properties Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
type_qualifiers Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unary Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
cycle.md [ty] add cycle handling for FunctionType::signature query (#17833) 2025-05-05 12:12:38 -07:00
dataclass_transform.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
dataclasses.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
decorators.md [ty] Specialize bound methods and nominal instances (#17865) 2025-05-05 17:17:36 -04:00
descriptor_protocol.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
metaclass.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
mro.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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 Rename Red Knot (#17820) 2025-05-03 19:49:15 +02: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