[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-14 Thread Vioshim
Oh certainly that's the approach I was intending, basically wanted to make an enum that shares the methods that the original class can do, but this is quite helpful, I've been testing this approach and seems to work very well despite only working with *args, thanks a lot for the reply and everyo

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Ethan Furman
On 12/13/21 3:34 PM, Steven D'Aprano wrote: > I think this may be what you are looking for: [...] Beat me to it. :-) -- ~Ethan~ ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Ethan Furman
On 12/12/21 10:43 PM, Vioshim wrote: > Anyways, at the moment that I write this message in python3.10.1, It happens that when making a class with the dataclasses module, this class can't actually be used in Multiple inheritance for Enum purposes, this is mostly to avoid code repetition by havin

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Steven D'Aprano
On Mon, Dec 13, 2021 at 06:43:27AM -, Vioshim wrote: > Anyways, at the moment that I write this message in python3.10.1, It > happens that when making a class with the dataclasses module, this > class can't actually be used in Multiple inheritance for Enum > purposes, this is mostly to avo

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Christopher Barker
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: c

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Eric V. Smith
On 12/13/2021 1:43 AM, Vioshim wrote: Hello good morning. I've decided to open a discussion of a topic that I consider should be part of dataclasses, but not sure how suggestions work and many threads recommend to check python dev first so-. Anyways, at the moment that I write this message in