From 3f3713d614ae60d5a3659209212f887167973a27 Mon Sep 17 00:00:00 2001 From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com> Date: Mon, 5 Apr 2021 00:41:28 +0800 Subject: [PATCH] Update with pending changes to PEP --- Doc/reference/compound_stmts.rst | 4 ++-- Doc/reference/datamodel.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index e13d6dd956209f..aae7c7f68b6e05 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -1030,7 +1030,7 @@ subject value: For a number of built-in types (specified below), a single positional subpattern is accepted which will match the entire subject; for these types - no keyword patterns are accepted. + keyword patterns also work as for other types. If only keyword patterns are present, they are processed as follows, one by one: @@ -1057,7 +1057,7 @@ subject value: * If this raises an exception, the exception bubbles up. - * If the returned value is not a list or tuple, the conversion fails and + * If the returned value is not a tuple, the conversion fails and :exc:`TypeError` is raised. * If there are more positional patterns than ``len(cls.__match_args__)``, diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index dfe5eb6857c0f5..9c819b7ae6d28f 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -2565,7 +2565,7 @@ define a *__match_args__* attribute. .. data:: object.__match_args__ - This class variable can be assigned a tuple or list of strings. When this class is + This class variable can be assigned a tuple of strings. When this class is used in a class pattern with positional arguments, each positional argument will be converted into a keyword argument, using the corresponding value in *__match_args__* as the keyword. The absence of this attribute is equivalent to