Commit 9da9645
committed
Normalize str values in SetManager.__contains__
After #238's follow-ups, SetManager normalizes (lowercase, strip leading/
trailing periods) in add(), remove(), the constructor, and every set
operator -- __contains__ was the lone holdout, so 'Dr.' in c.titles returned
False even though every other operation on the same value succeeded. The ABC
comparison mixins (__le__, __eq__, etc.) route through __contains__, so this
also fixes subset/equality checks against un-normalized operands.
lc() is idempotent, so the parser's own lc()-normalized lookups are
unaffected.
Fixes #2441 parent 69bc98c commit 9da9645
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
127 | 144 | | |
128 | 145 | | |
129 | 146 | | |
| |||
0 commit comments