PEP 646: Fix typo in the example code (#1808)

This commit is contained in:
Gus Monod 2021-02-09 15:38:54 +00:00 committed by GitHub
parent 604b51399c
commit 1d68240e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -401,7 +401,7 @@ each element looking for example like these:
Until now, our patterns have processed sequences, but there are patterns to match
mappings based on their present keys. In this case you could use::
for action in message:
for action in actions:
match action:
case {"text": message, "color": c}:
ui.set_text_color(c)
@ -437,7 +437,7 @@ are both strings. For many builtin classes (see PEP-634 for the whole list), you
use a positional parameter as a shorthand, writing ``str(c)`` rather than ``str() as c``.
The fully rewritten version looks like this::
for action in message:
for action in actions:
match action:
case {"text": str(message), "color": str(c)}:
ui.set_text_color(c)