Skip to content

Commit

Permalink
Tutorial: specify match cases don't fall through (GH-93615) (GH-94083)
Browse files Browse the repository at this point in the history
(cherry picked from commit dd5cf84)

Co-authored-by: max <[email protected]>
  • Loading branch information
miss-islington and pr2502 authored Jun 21, 2022
1 parent c76e6f7 commit 736f545
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Doc/tutorial/controlflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ at a more abstract level. The :keyword:`!pass` is silently ignored::
A :keyword:`match` statement takes an expression and compares its value to successive
patterns given as one or more case blocks. This is superficially
similar to a switch statement in C, Java or JavaScript (and many
other languages), but it can also extract components (sequence elements or
object attributes) from the value into variables.
other languages), but it's more similar to pattern matching in
languages like Rust or Haskell. Only the first pattern that matches
gets executed and it can also extract components (sequence elements
or object attributes) from the value into variables.

The simplest form compares a subject value against one or more literals::

Expand Down

0 comments on commit 736f545

Please sign in to comment.