[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

Brandt Bucher report at bugs.python.org
Mon Apr 12 12:35:21 EDT 2021


Brandt Bucher <brandtbucher at gmail.com> added the comment:

> For named tuples, there isn't an include/exclude option, so no extra mention is warranted.

I think a note in the docs could still be valuable, if only because defining __match_args__ for named tuples changes the inherited tuple behavior for positional matches quite significantly: "case tuple(x)" and "case MyNT(x)" don't mean the same thing.

(Although perhaps this could be inferred from the new constructor signature.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43761>
_______________________________________


More information about the Python-bugs-list mailing list