12 Apr 2020 12 Apr '20
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?
Age (days ago)
Last active (days ago)