parent
1d43bca863
commit
481752e211
|
@ -379,7 +379,7 @@ Appendix A -- Quick Intro
|
||||||
|
|
||||||
A ``match`` statement takes an expression and compares it to successive
|
A ``match`` statement takes an expression and compares it to successive
|
||||||
patterns given as one or more ``case`` blocks. This is superficially
|
patterns given as one or more ``case`` blocks. This is superficially
|
||||||
similar to a ``switch`` statement in C, Java or JavaScript (an many
|
similar to a ``switch`` statement in C, Java or JavaScript (and many
|
||||||
other languages), but much more powerful.
|
other languages), but much more powerful.
|
||||||
|
|
||||||
The simplest form compares a subject value against one or more literals::
|
The simplest form compares a subject value against one or more literals::
|
||||||
|
@ -533,7 +533,7 @@ Several other key features:
|
||||||
case True:
|
case True:
|
||||||
print("Yes!")
|
print("Yes!")
|
||||||
|
|
||||||
is exactly quivalent to this::
|
is exactly equivalent to this::
|
||||||
|
|
||||||
if b is True:
|
if b is True:
|
||||||
print("Yes!")
|
print("Yes!")
|
||||||
|
|
Loading…
Reference in New Issue