MCPcopy Create free account
hub / github.com/pybind/pybind11 / SanitizedString

Class SanitizedString

tests/conftest.py:155–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153
154
155class 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
176def _sanitize_general(s):

Callers 2

docFunction · 0.85
msgFunction · 0.85

Calls

no outgoing calls

Tested by 2

docFunction · 0.68
msgFunction · 0.68