2 ms·
The article doesn't discuss slots and default values. Here's the actual reference implementation for dataclasses where it's discussed: https://github.com/ericv
by dfee 8y ago
The article doesn't discuss slots and default values. Here's the actual reference implementation for dataclasses where it's discussed: https://github.com/ericvsmith/dataclasses/issues/28 https://github.com/ericvsmith/dataclasses/issues/28
Your second solution works fine (and is what I'd referenced). For your first solution, I'd again redirect you to my statement "they don’t support __slots__ and default values" and the above link.
- sologoub 8y agoIt’s not my solution, just a direct quote from PEP.