bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)

The "Color" example in the pattern-matching section of the "control flow" documentation is not immediately runnable, leading to confusion.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 1cbb88736c)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-12-14 07:25:32 -08:00 committed by GitHub
parent f84e2f6c0a
commit 503803d8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -395,9 +395,11 @@ Several other key features of this statement:
from enum import Enum
class Color(Enum):
RED = 0
GREEN = 1
BLUE = 2
RED = 'red'
GREEN = 'green'
BLUE = 'blue'
color = Color(input("Enter your choice of 'red', 'blue' or 'green': "))
match color:
case Color.RED: