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
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/6YMRI4BJDTZZTWM6XQ6EQDZ47RWX4C7C/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to