Dataclasses should provide a way to ignore a type hinted attributes, and not consider them as fields.
For example, some attributes might be derived during `__post_init__` from the values of the fields or other variables.
If one wants to still type hint these attributes, one has to awkward workarounds to avoid having dataclass interpret them as fields. (https://stackoverflow.com/questions/76532816)
But it’s not clear (to me) why not being a field is desirable. Why is it important?
Eric
_______________________________________________Python-ideas mailing list -- [email protected]To unsubscribe send an email to [email protected]https://mail.python.org/mailman3/lists/python-ideas.python.org/Message archived at https://mail.python.org/archives/list/[email protected]/message/C5QJQT5YV7UOKFF57PWD4VSF4RWUDOSF/Code of Conduct: http://python.org/psf/codeofconduct/
|
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/AIBVZMIW7KYLY3T5Y3FNK2POVSNBIUTJ/
Code of Conduct: http://python.org/psf/codeofconduct/