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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QW7R6ZP4BHAZTCIQVRJCD6WY24LATFMQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to