PEP 636: Fix mistake caught by @merwok (#1678)
This commit is contained in:
parent
8fba056c41
commit
e52ed7f4df
|
@ -316,10 +316,10 @@ different kinds of objects, and also apply patterns to its attributes::
|
||||||
case other_event:
|
case other_event:
|
||||||
raise ValueError(f"Unrecognized event: {other_event}")
|
raise ValueError(f"Unrecognized event: {other_event}")
|
||||||
|
|
||||||
A pattern like ``Click(position=(x, y))`` only matches if the actual event is a subclass of
|
A pattern like ``Click(position=(x, y))`` only matches if the the type of the event is
|
||||||
the ``Click`` class. It will also requires that the event has a ``position`` attribute
|
a subclass of the ``Click`` class. It will also requires that the event has a ``position``
|
||||||
that matches the ``(x, y)`` pattern. If there's a match, the locals ``x`` and ``y`` will
|
attribute that matches the ``(x, y)`` pattern. If there's a match, the locals ``x`` and
|
||||||
get the expected values.
|
``y`` will get the expected values.
|
||||||
|
|
||||||
A pattern like ``KeyPress()``, with no arguments will match any object which is an
|
A pattern like ``KeyPress()``, with no arguments will match any object which is an
|
||||||
instance of the ``KeyPress`` class. Only the attributes you specify in the pattern are
|
instance of the ``KeyPress`` class. Only the attributes you specify in the pattern are
|
||||||
|
|
Loading…
Reference in New Issue