News for hackers. Stuff that matters.
Re:Data Classification: Does Python still have a need for cl... by seanhunter on Tuesday February 14, 2023 @11:54AM (#34792174)
There's all kinds of use cases for classes without dataclass. For example, just the other day I wrote a leaky bucket rate limiter class. It uses the __aenter__ and __aexit__ methods to do things in async with blocks.

I love dataclasses, but there needs to be a compelling reason to break everyone's code and the reason can't just be "I don't want one import and one decorator".

Re:Data Classification: Does Python still have a need for cl... by glyph on Tuesday February 14, 2023 @08:25PM (#34798834)
why do you think you can't define `__aenter__` and `__aexit__` on a dataclass?
Re:Data Classification: Does Python still have a need for cl... by seanhunter on Wednesday February 15, 2023 @04:30AM (#34801705)
I don't. But it's really not a dataclass - it doesn't need slots etc.