March 14, 2021
9:36 a.m.
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?