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
importabcfromdataclassesimportdataclass@dataclass# error: Only concrete class can be given where "Type[Abstract]" is expectedclassAbstract(metaclass=abc.ABCMeta):
a: str@abc.abstractmethoddefc(self) ->None:
pass@dataclassclassConcrete(Abstract):
b: strdefc(self) ->None:
passinstance=Concrete(a='hello', b='world')
Note that this error only occurs if at least one abstract method is defined on the abstract class. Removing the abstract method c (or making it non-abstract) makes the error go away.
languitar, antdking, csabaszilveszter, saulshanabrook, glyph and 139 morealdanor, Veganveins, ET-Chan, rolyp, agronskiy and 4 moreYobmod, schneiderfelipe, marcellovictorino, chey, aucampia and 1 more