summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-21 19:53:07 (GMT)
committerGitHub <noreply@github.com>2022-06-21 19:53:07 (GMT)
commit4b2d7f3f4e160fdb482eefa377882d1c2c8ccb1b (patch)
tree5e429dc592eae55fcb902238a2c4bc351ae75353 /Doc
parent6432a8972b27aa0f2ef625ec538f8487f12e14de (diff)
downloadcpython-4b2d7f3f4e160fdb482eefa377882d1c2c8ccb1b.zip
cpython-4b2d7f3f4e160fdb482eefa377882d1c2c8ccb1b.tar.gz
cpython-4b2d7f3f4e160fdb482eefa377882d1c2c8ccb1b.tar.bz2
Tutorial: specify match cases don't fall through (GH-93615) (GH-94084)
(cherry picked from commit dd5cf84f245abf84405833320b8f25dbc43b24d2) Co-authored-by: max <36980911+pr2502@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tutorial/controlflow.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index f6e013b..99a77e7 100644
--- a/Doc/tutorial/controlflow.rst
+++ b/Doc/tutorial/controlflow.rst
@@ -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::