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
..
2025-05-07 15:58:00 -07:00
2025-05-03 19:49:15 +02:00
2025-05-08 14:10:35 +01:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-07 15:58:00 -07:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-08 10:30:04 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-06 20:11:25 -04:00
2025-05-07 23:29:44 +01:00
2025-05-08 19:01:27 -04:00
2025-05-08 23:54:19 +01:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-08 10:30:04 -04:00
2025-05-03 19:49:15 +02:00
2025-05-08 17:21:34 +01:00
2025-05-06 20:11:25 -04:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-07 15:21:11 -04:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-08 19:01:27 -04:00
2025-05-05 12:12:38 -07:00
2025-05-07 15:51:13 +02:00
2025-05-06 20:11:25 -04:00
2025-05-05 17:17:36 -04:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 12:37:10 +01:00
2025-05-06 20:11:25 -04:00
2025-05-08 22:57:39 +01:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-08 23:41:22 +01:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-06 20:11:25 -04:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00
2025-05-03 19:49:15 +02:00