[issue43923] Can't create generic NamedTuple as of py3.9
Guido van Rossum
report at bugs.python.org
Fri Mar 4 21:55:26 EST 2022
Guido van Rossum <guido at python.org> added the comment:
Mypy seems to allow this:
from typing import NamedTuple, TypeVar, Generic, List, Tuple
T = TypeVar("T")
class New(NamedTuple, Generic[T]):
x: List[T]
y: Tuple[T, T]
It's true that pyright doesn't, but maybe that's because it doesn't work in 3.9-3.10?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43923>
_______________________________________
More information about the Python-bugs-list
mailing list