Traceback (most recent call last):
File "/home/rscholz/Downloads/tmp.py", line 3, in <module>
class Baz[U](Bar[U]): ...
File "/home/rscholz/Downloads/tmp.py", line 3, in <generic parameters of Baz>
class Baz[U](Bar[U]): ...
File "/usr/lib/python3.13/typing.py", line 1288, in _generic_init_subclass
raise TypeError(f"Some type variables ({s_vars}) are"
f" not listed in Generic[{s_args}]")
TypeError: Some type variables (T) are not listed in Generic[U]
Bug report
Bug description:
The following example raises a
TypeError: Some type variables (T) are not listed in Generic[U]:Full Traceback
The PEP states that
And the typing spec uses similar phrasing, which makes me believe this is a bug. In the example above, I'd expect that
Baz[U]is aBar[U, U]by substitution + default.CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs