| 153 | |
| 154 | |
| 155 | class SanitizedString: |
| 156 | def __init__(self, sanitizer): |
| 157 | self.sanitizer = sanitizer |
| 158 | self.string = "" |
| 159 | self.explanation = [] |
| 160 | |
| 161 | def __call__(self, thing): |
| 162 | self.string = self.sanitizer(thing) |
| 163 | return self |
| 164 | |
| 165 | __hash__ = None |
| 166 | |
| 167 | def __eq__(self, other): |
| 168 | a = self.string |
| 169 | b = _strip_and_dedent(other) |
| 170 | if a == b: |
| 171 | return True |
| 172 | self.explanation = _make_explanation(a.splitlines(), b.splitlines()) |
| 173 | return False |
| 174 | |
| 175 | |
| 176 | def _sanitize_general(s): |