Skip to content

Commit d635956

Browse files
authored
PEP 634: Change so __match_args__ must be a tuple (#1909)
1 parent 0ded16b commit d635956

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pep-0634.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ as follows:
492492
the entire subject; for these types no keyword patterns are accepted.
493493
- The equivalent of ``getattr(cls, "__match_args__", ()))`` is called.
494494
- If this raises an exception the exception bubbles up.
495-
- If the returned value is not a list or tuple, the conversion fails
495+
- If the returned value is not a tuple, the conversion fails
496496
and ``TypeError`` is raised.
497497
- If there are more positional patterns than the length of
498-
``__match_args__``` (as obtained using ``len()``), ``TypeError`` is raised.
498+
``__match_args__`` (as obtained using ``len()``), ``TypeError`` is raised.
499499
- Otherwise, positional pattern ``i`` is converted to a keyword pattern
500500
using ``__match_args__[i]`` as the keyword,
501501
provided it the latter is a string;
@@ -513,7 +513,7 @@ positional subpatterns is different:
513513
This behavior is roughly equivalent to the following::
514514

515515
class C:
516-
__match_args__ = ["__match_self_prop__"]
516+
__match_args__ = ("__match_self_prop__",)
517517
@property
518518
def __match_self_prop__(self):
519519
return self

0 commit comments

Comments
 (0)