-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codefeaturepriority-1-normaltopic-named-tuple
Description
I tried this for a generic NamedTuple:
S = TypeVar("S")
T = TypeVar("T")
class Pair(Generic[S, T],
NamedTuple("Pair",[
('fst', S),
('second', T)])):
def show(self):
print(self.fst, self.second)
p = Pair("ab", 22) # type: Pair[str, int]
Mypy raised an exception: RuntimeError: TypeVarType is already analysed
.
Related question: is this the right way to define a generic NamedTuple?
Thanks!
mitar, MarkusRabe, senyai, corydolphin, earshinov and 23 more
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codefeaturepriority-1-normaltopic-named-tuple