Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a22bca6

Browse files
dmoissetwillingcFidget-Spinnerbrandtbucherrhettinger
authored
bpo-42128: Add documentation for pattern matching (PEP 634) (#24664)
This is a first edition, ready to go out with the implementation. We'll iterate during the rest of the period leading up to 3.10.0. Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Fidget-Spinner <[email protected]> Co-authored-by: Brandt Bucher <[email protected]> Co-authored-by: Raymond Hettinger <[email protected]> Co-authored-by: Guido van Rossum <[email protected]>
1 parent d202794 commit a22bca6

5 files changed

Lines changed: 821 additions & 3 deletions

File tree

Doc/faq/design.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ Why isn't there a switch or case statement in Python?
259259
-----------------------------------------------------
260260

261261
You can do this easily enough with a sequence of ``if... elif... elif... else``.
262-
There have been some proposals for switch statement syntax, but there is no
263-
consensus (yet) on whether and how to do range tests. See :pep:`275` for
264-
complete details and the current status.
262+
For literal values, or constants within a namespace, you can also use a
263+
``match ... case`` statement.
265264

266265
For cases where you need to choose from a very large number of possibilities,
267266
you can create a dictionary mapping case values to functions to call. For

0 commit comments

Comments
 (0)