PEP 636: Add missing colons at the end of case statement (#1815)
Signed-off-by: Matej Dujava <mdujava@kocurkovo.cz> Co-authored-by: Matej Dujava <mdujava@win.kocurkovo.cz>
This commit is contained in:
parent
d0a76d4ffc
commit
7d7965bf2d
|
@ -408,9 +408,9 @@ mappings based on their present keys. In this case you could use::
|
|||
ui.display(message)
|
||||
case {"sleep": duration}:
|
||||
ui.wait(duration)
|
||||
case {"sound": url, "format": "ogg"}
|
||||
case {"sound": url, "format": "ogg"}:
|
||||
ui.play(url)
|
||||
case {"sound": _, "format": _}
|
||||
case {"sound": _, "format": _}:
|
||||
warning("Unsupported audio format")
|
||||
|
||||
The keys in your mapping pattern need to be literals, but the values can be any
|
||||
|
@ -444,9 +444,9 @@ The fully rewritten version looks like this::
|
|||
ui.display(message)
|
||||
case {"sleep": float(duration)}:
|
||||
ui.wait(duration)
|
||||
case {"sound": str(url), "format": "ogg"}
|
||||
case {"sound": str(url), "format": "ogg"}:
|
||||
ui.play(url)
|
||||
case {"sound": _, "format": _}
|
||||
case {"sound": _, "format": _}:
|
||||
warning("Unsupported audio format")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue