MCPcopy Index your code
hub / github.com/python/mypy / str_repr

Method str_repr

mypy/strconv.py:381–383  ·  view source on GitHub ↗
(self, s: str)

Source from the content-addressed store, hash-verified

379 return f"BytesExpr({self.str_repr(o.value)})"
380
381 def str_repr(self, s: str) -> str:
382 s = re.sub(r"\\u[0-9a-fA-F]{4}", lambda m: "\\" + m.group(0), s)
383 return re.sub("[^\\x20-\\x7e]", lambda m: r"\u%.4x" % ord(m.group(0)), s)
384
385 def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> str:
386 return f"FloatExpr({o.value})"

Callers 2

visit_str_exprMethod · 0.95
visit_bytes_exprMethod · 0.95

Calls 2

ordFunction · 0.85
groupMethod · 0.80

Tested by

no test coverage detected