Don't special case named tuples. The default behavior is fine. (#1874)

This commit is contained in:
Mark Shannon 2021-03-16 11:15:21 +00:00 committed by GitHub
parent 31d814345e
commit 54a16d60ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -150,8 +150,7 @@ implement ``__deconstruct__()`` and should consider redefining ``__match_args__`
* ``__deconstruct__()``: should return a sequence which contains the parts of the deconstructed object. * ``__deconstruct__()``: should return a sequence which contains the parts of the deconstructed object.
.. note:: .. note::
``__match_args__`` will be automatically generated for dataclasses, as specified in PEP 634. ``__match_args__`` will be automatically generated for dataclasses and named tuples, as specified in PEP 634.
``__match_args__`` and ``__deconstruct__`` will be automatically generated for named tuples.
The pattern matching implementation is *not* required to check that ``__match_args__`` and ``__deconstruct__`` behave as specified. The pattern matching implementation is *not* required to check that ``__match_args__`` and ``__deconstruct__`` behave as specified.
If the value of ``__match_args__`` or the result of ``__deconstruct__()`` is not as specified, then If the value of ``__match_args__`` or the result of ``__deconstruct__()`` is not as specified, then