Skip to content

Commit 736f545

Browse files
Tutorial: specify match cases don't fall through (GH-93615) (GH-94083)
(cherry picked from commit dd5cf84) Co-authored-by: max <36980911+pr2502@users.noreply.github.com>
1 parent c76e6f7 commit 736f545

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/tutorial/controlflow.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ at a more abstract level. The :keyword:`!pass` is silently ignored::
253253
A :keyword:`match` statement takes an expression and compares its value to successive
254254
patterns given as one or more case blocks. This is superficially
255255
similar to a switch statement in C, Java or JavaScript (and many
256-
other languages), but it can also extract components (sequence elements or
257-
object attributes) from the value into variables.
256+
other languages), but it's more similar to pattern matching in
257+
languages like Rust or Haskell. Only the first pattern that matches
258+
gets executed and it can also extract components (sequence elements
259+
or object attributes) from the value into variables.
258260

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy