4 ms·
Maybe that would have worked better with a metaclass. But still, I think not using a metaclass is the more flexible design. Maybe I'll add the "add_slots" beha
by ericvsmith 6y ago
Maybe that would have worked better with a metaclass.
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!
- kzrdude 6y agoMaybe the __slots__ discussion is not really that important - it's just convenience, and the regular old method of adding slots still works. So it's a minor thing. I have diligently converted to f-strings but it doesn't give me new expressibility like I feel dataclasses do, just convenience :)
- imcoconut 6y agofstrings and datclasses changed my life. thank you :)