You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I hope this is the right place for this, if not, just let me know.
I'm trying to create a generic version of a NamedTuple, as follows:
T1=TypeVar("T1")
T2=TypeVar("T2")
classGroup(NamedTuple, Generic[T1, T2]):
key: T1group: List[T2]
g=Group(1, [""]) # expecting type to be G[int, str]
However, I get the following error: TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
I'm not sure how else to achieve what I'm trying to do here, or if this might be a bug in the typing mechanism on some level.
Any help?
The text was updated successfully, but these errors were encountered:
First of all, I hope this is the right place for this, if not, just let me know.
I'm trying to create a generic version of a NamedTuple, as follows:
However, I get the following error:
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
I'm not sure how else to achieve what I'm trying to do here, or if this might be a bug in the typing mechanism on some level.
Any help?
The text was updated successfully, but these errors were encountered: