-
-
Notifications
You must be signed in to change notification settings - Fork 422
Open
Labels
Description
attrs is the inspiration for and the continuously improved version of the Python dataclasses with many additional features and almost 4 hundred million downloads last month, according to ClickPy. I would like to request that two new output model types be added:
attrs.definefor generating attrs classes using its new API, andattr.dataclassas a drop-in replacement ofdataclasses.dataclassfor better interop with attrs.
The latter output type should be easy to implement, as currently I only need to monkey patch one line in the generated file: change from dataclasses import dataclass to from attr import dataclass. But this tiny change allows, for example, attrs.fields(C) to list the attrs attributes of the decorated class C, and once #2437 lands, more customization options would become available for free.