[issue39247] dataclass defaults and property don't work together

Eric V. Smith report at bugs.python.org
Sat Jun 5 21:08:57 EDT 2021


Eric V. Smith <eric at trueblade.com> added the comment:

> _uploaded_by: str = dataclasses.field(alias="uploaded_by", default=None, init=False)

That's an interesting idea. I'll play around with it. I'm not sure "alias" feels quite right, as it only applies to __init__ (if I'm understanding it correctly).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39247>
_______________________________________


More information about the Python-bugs-list mailing list