Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 653: Don't special case named tuples; the default behavior is fine. #1874

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pep-0653.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

.. note::
``__match_args__`` will be automatically generated for dataclasses, as specified in PEP 634.
``__match_args__`` and ``__deconstruct__`` will be automatically generated for named tuples.
``__match_args__`` will be automatically generated for dataclasses and named tuples, as specified in PEP 634.

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
Expand Down