Skip to content

Commit 23afed2

Browse files
committed
tweak docs
1 parent 3eaa5ad commit 23afed2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

docs/source/error_code_list2.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -636,25 +636,18 @@ Example:
636636
637637
val: Color = Color.RED
638638
639-
# without --enable-error-code exhaustive-match
639+
# OK without --enable-error-code exhaustive-match
640640
match val:
641641
case Color.RED:
642642
print("red")
643643
644-
# Also no issues without --enable-error-code exhaustive-match, but this is exhaustive
645-
match val:
646-
case Color.RED:
647-
print("red")
648-
case _:
649-
print("other")
650-
651-
# with --enable-error-code exhaustive-match
652-
# error: Cases within match statement do not exhaustively handle all values: "Literal[Color.BLUE]". If not intended to handle all cases, use `case _: pass`
644+
# With --enable-error-code exhaustive-match
645+
# Error: Match statement has unhandled case for values of type "Literal[Color.BLUE]"
653646
match val:
654647
case Color.RED:
655648
print("red")
656649
657-
# no error with --enable-error-code exhaustive-match since all cases are handled
650+
# OK with or without --enable-error-code exhaustive-match, since all cases are handled
658651
match val:
659652
case Color.RED:
660653
print("red")

0 commit comments

Comments
 (0)