
12 Apr
2020
12 Apr
'20
12:46 a.m.
Dear Pythoners,
class X: def __init__(self, x, **kwargs): super().__init__(**kwargs) print(x, kwargs)
@dataclass class Y(X): y: int
Y(1) # What should happen? Y(1, 2) # What should happen?
I feel like it would be nice to be able to use dataclasses more often without worrying that you cannot use dataclasses in cooperative inheritance. Perhaps, dataclasses could call super with unused args and kwargs?
Best,
Neil
1155
Age (days ago)
1155
Last active (days ago)
0 comments
1 participants
participants (1)
-
Neil Girdhar