[Python-checkins] Tutorial: specify match cases don't fall through (GH-93615)

ambv webhook-mailer at python.org
Tue Jun 21 15:44:15 EDT 2022


https://github.com/python/cpython/commit/dd5cf84f245abf84405833320b8f25dbc43b24d2
commit: dd5cf84f245abf84405833320b8f25dbc43b24d2
branch: main
author: max <36980911+pr2502 at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2022-06-21T21:44:09+02:00
summary:

Tutorial: specify match cases don't fall through (GH-93615)

files:
M Doc/tutorial/controlflow.rst

diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index f6e013b23e7e5..99a77e7addd77 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::
 



More information about the Python-checkins mailing list