Skip to content

Commit 967331c

Browse files
committed
* 'master' of https://github.com/mikeckennedy/python-switch: made the second range contain more than one item. : not ,
2 parents ef3c2ce + 8dca331 commit 967331c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ value = 4 # matches first case
5959

6060
with switch(value) as s:
6161
s.case(range(1, 6), lambda: ...)
62-
s.case(range(6, 7), lambda: ...)
62+
s.case(range(6, 10), lambda: ...)
6363
s.default(lambda: ...)
6464
```
6565

@@ -81,7 +81,7 @@ You write the following code.
8181
switch = {
8282
1: method_on_one,
8383
2: method_on_two,
84-
3, method_on_three
84+
3: method_three
8585
}
8686

8787
result = switch.get(value, defult_method_to_run)()
@@ -138,4 +138,4 @@ while True:
138138
```
139139

140140
Personally, I much prefer to read and write the one above. That's why I wrote this module.
141-
It seems to convey the intent of switch way more than the dict. But either are options.
141+
It seems to convey the intent of switch way more than the dict. But either are options.

0 commit comments

Comments
 (0)