I believe this is the example where dataclasses could have supported __slots__ better with a metaclass?
Thanks for working on dataclasses :) - as I said, it's my #1 new feature in Python.
Thanks for working on dataclasses :) - as I said, it's my #1 new feature in Python.
But still, I think not using a metaclass is the more flexible design. Maybe I'll add the "add_slots" behavior into the @dataclass decorator in 3.10, even though it would need to return a new class. At least it could be well documented, and I doubt it's a concern for most people.
> Thanks for working on dataclasses :) - as I said, it's my #1 new feature in Python.
I'm offended! I also wrote f-strings, but maybe that's not considered new anymore. In any event, you're welcome!
I have diligently converted to f-strings but it doesn't give me new expressibility like I feel dataclasses do, just convenience :)