I've seen this thread, and also wondered why anyone could EVER want a dataclass that is an enum.  Nothing I've seen in the thread gives me any hint about that, really.

On Sun, Jul 10, 2022 at 7:44 AM Barry Scott <barry@barrys-emacs.org> wrote:


> On 9 Jul 2022, at 22:53, Steve Jorgensen <stevecjor@gmail.com> wrote:
>
> I don't think that dataclasses have the limited set of intended uses that you are interpreting them as having. To me, the fact that they can be frozen makes them a good fit with Enum.

Please quote the email that you are replying to.

It is usually considered a code smell to have a class that is two or more things.
This seems to be what you are trying to do.

How can one class be a set of fields and also the enum for one of its own fields?
I do not understand why this is resonable.

Barry



> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-leave@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/V6U7UMQRTLDZ2W6SWREL472L6ZH7MHB5/
> Code of Conduct: http://python.org/psf/codeofconduct/
>

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/HZFZE3YMCMT6CF5VZHNM6ZJVDAX6LZXK/
Code of Conduct: http://python.org/psf/codeofconduct/


--
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.