Repository navigation
Commit 753f8f8
committed
Take the proposal bounds apart with
The `match` covered all four combinations of a proposal's optional lower and
upper bounds, but mypy can't narrow tuple items across `case` clauses (see
python/mypy#12364), so it can't prove such a `match` exhaustive no matter how
many cases are written.
Nested `if`s over the two bounds cover the same four combinations, mypy does
check those, and the shared code between the cases no longer needs repeating.
There is no behaviour change.
Signed-off-by: Leandro Lucarella <[email protected]>ifs instead of a match
1 parent 0aa21e7 commit 753f8f8
1 file changed
Lines changed: 16 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
127 | 132 | | |
128 | 133 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
0 commit comments