4 ms·
namedtuple yes, it's a tuple so can be unpacked (by position) and dataclasses can not be unpacked. But with the new pattern matching, you can "unpack" dataclass
by kzrdude 5y ago
namedtuple yes, it's a tuple so can be unpacked (by position) and dataclasses can not be unpacked. But with the new pattern matching, you can "unpack" dataclass objects that way!
https://peps.python.org/pep-0636/ https://peps.python.org/pep-0636/