Speaking as someone who's not into dataclasses:
This whole thread seems to be about spelling the initilizer's function
signature as a class body. Have you considered going in the opposite
direction, i. e. writing something like
@dataclass
class A:
@attributes_from_signature
def __init__(self, ham, spam=None):
pass
or
@attributes_from_signature
def A(ham, spam=None):
pass
to autogenerate a class A with with attributes ham and spam?
_______________________________________________
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/QW7R6ZP4BHAZTCIQVRJCD6WY24LATFMQ/
Code of Conduct: http://python.org/psf/codeofconduct/