PEP 622: Show Point(x=1, y=2) in class pattern section
This commit is contained in:
parent
acffe50fdf
commit
1560745bdc
|
@ -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::
|
||||
|
|
Loading…
Reference in New Issue