]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Tutorial: specify match cases don't fall through (GH-93615)
authormax <36980911+pr2502@users.noreply.github.com>
Tue, 21 Jun 2022 19:44:09 +0000 (21:44 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Jun 2022 19:44:09 +0000 (21:44 +0200)
Doc/tutorial/controlflow.rst

index f6e013b23e7e58f043f68d3e51a553d1e636f987..99a77e7addd7741badd66f6f0dc84f02bc27bfec 100644 (file)
@@ -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::