[Python-ideas] Consider adding an iterable option to dataclass
mistersheik at gmail.com
Fri Aug 10 19:01:59 EDT 2018
It would be nice if dataclasses
had an option to make them a sequence. This would make
dataclass(frozen=True, order=True, sequence=True)
an optionally-typed version of namedtuple. It would almost totally
supplant it except that namedtuples have a smaller memory footprint.
sequence would simply inherit from collections.abc.Sequence and implement
the two methods __len__ and __getitme__.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas