Skip to content

Commit cce843d

Browse files
committed
add intro
1 parent 83427b4 commit cce843d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/basics/pattern.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ author: Péter Györök
55
---
66
# Pattern Matching
77

8+
Pattern matching allows an object such as a list or dictionary to be matched to a pattern, assigning variables to its parts, checking types, and/or modifying values via a filter function. It can simplify unpacking multiple objects passed to and returned from functions, and reduce the overhead of type checking.
9+
810
## Assignment
911

1012
The left side of the [assignment](../ref/assign.md) operator may be a pattern. Various kinds of patterns have different effects. When used in an assignment, the pattern must have parentheses around it. A failed match results in no variables being changed.

0 commit comments

Comments
 (0)