PEP 622: Show Point(x=1, y=2) in class pattern section

This commit is contained in:
Guido van Rossum 2020-06-24 17:04:34 -07:00
parent acffe50fdf
commit 1560745bdc
1 changed files with 1 additions and 1 deletions

View File

@ -391,7 +391,7 @@ Class Pattern
A class pattern provides support for destructuring arbitrary objects.
There are two possible ways of matching on object attributes: by position
like ``Point(1, 2)``, and by name like ``User(id=id, name="Guest")``. These
like ``Point(1, 2)``, and by name like ``Point(x=1, y=2)``. These
two can be combined, but positional match cannot follow a match by name.
Each item in a class pattern can be an arbitrary pattern. A simple
example::