Repository navigation
Commit ea94700
committed
fix: Keep booleans and numbers distinct in the in operator
Python's bool is a subclass of int, so True == 1 and False == 0. This
caused the in clause operator to match boolean context values against
numeric clause values (and vice versa), e.g. a context where tier is
True incorrectly matched a rule checking tier in [1].
The in operator now rejects a match when exactly one side is a bool,
keeping boolean and numeric JSON values distinct while still matching
True == True and False == False.1 parent 08e9f05 commit ea94700
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
| |||
0 commit comments