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
The following code does not throw errors in 0.730, but does in 0.740. Likely to do with #7723
classA:
def__init_subclass__(cls, *args, **kwargs):
super().__init_subclass__(*args, **kwargs)
classB(A):
pass# error: Too few arguments for "__init_subclass__"
And slightly more complicated, a self registering subclass:
fromtypingimportClassVar, List, TypeclassA:
registered_classes: ClassVar[List[Type["A"]]] = []
def__init_subclass__(cls, *args, register=True, **kwargs):
ifregister:
cls.registered_classes.append(cls)
super().__init_subclass__(*args, **kwargs)
classB(A):
passclassC(A, register=False):
passclassD(C):
passprint(A.registered_classes) # >>> [<class '__main__.B'>, <class '__main__.D'>]# 13: error: Too few arguments for "__init_subclass__"# 17: error: Missing positional argument "cls" in call to "__init_subclass__"# 21: error: Too few arguments for "__init_subclass__"
The text was updated successfully, but these errors were encountered:
The following code does not throw errors in 0.730, but does in 0.740. Likely to do with #7723
And slightly more complicated, a self registering subclass:
The text was updated successfully, but these errors were encountered: