File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ value = 4 # matches first case
59
59
60
60
with switch(value) as s:
61
61
s.case(range (1 , 6 ), lambda : ... )
62
- s.case(range (6 , 7 ), lambda : ... )
62
+ s.case(range (6 , 10 ), lambda : ... )
63
63
s.default(lambda : ... )
64
64
```
65
65
@@ -81,7 +81,7 @@ You write the following code.
81
81
switch = {
82
82
1 : method_on_one,
83
83
2 : method_on_two,
84
- 3 , method_on_three
84
+ 3 : method_three
85
85
}
86
86
87
87
result = switch.get(value, defult_method_to_run)()
@@ -138,4 +138,4 @@ while True:
138
138
```
139
139
140
140
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.
You can’t perform that action at this time.
0 commit comments