I'm also confused about what you are trying to achieve here. Note that:
assert Entries.ENTRY1.value.a == 1
should work.
But my main thought is that dataclasses are really just a way to
auto-generate classes without having to write a bunch of boilerplate. So
you example above is equivalent to:
class Foo:
def __init__(self, a=0):
self.a = a
Which behaves the same way when used the same way with Enum.
So why should dataclasses be special in this particular way?
-CHB
--
Christopher Barker, PhD (Chris)
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/J7EEZUO7MI7RZT347C6VETUPCGBZIUYJ/
Code of Conduct: http://python.org/psf/codeofconduct/