You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ericvsmith'closed_at=Nonecreated_at=<Date2021-10-12.15:23:21.079>labels= ['type-feature', '3.11']
title='Add a way to hide fields in dataclasses'updated_at=<Date2021-10-13.16:12:44.238>user='https://bugs.python.org/formigacomcaimbra'
Does attrs have anything equivalent? This seems like a pretty niche usage, so I'm not inclined to include it without evidence of a wide-spread need for it.
Activity
ericvsmith commentedon Oct 12, 2021
Please explain what "hiding" does.
formigacomcaimbra commentedon Oct 12, 2021
The objective of this feature is to add a way to omit fields of a dataclass when
asdictorastupleis used.The main propuse is to add the
hideparameter infieldand add it as an attribute in theFieldclass.asdictwill ignore all fields that have thehideattribute set asTrue.---
Actually a possible solution to do it is doing this:
We need to make the same in
astupleand to avoid writingfield(metadata={"hide": True)multiple times we can useBut, this means that we can't reuse the
metadataparameter.ericvsmith commentedon Oct 13, 2021
"hide" is not a good name for this.
Does attrs have anything equivalent? This seems like a pretty niche usage, so I'm not inclined to include it without evidence of a wide-spread need for it.