MCPcopy Index your code
hub / github.com/nodejs/node / _MarkupEscapeHelper

Class _MarkupEscapeHelper

tools/inspector_protocol/markupsafe/__init__.py:211–222  ·  view source on GitHub ↗

Helper for Markup.__mod__

Source from the content-addressed store, hash-verified

209
210
211class _MarkupEscapeHelper(object):
212 """Helper for Markup.__mod__"""
213
214 def __init__(self, obj, escape):
215 self.obj = obj
216 self.escape = escape
217
218 __getitem__ = lambda s, x: _MarkupEscapeHelper(s.obj[x], s.escape)
219 __unicode__ = __str__ = lambda s: text_type(s.escape(s.obj))
220 __repr__ = lambda s: str(s.escape(repr(s.obj)))
221 __int__ = lambda s: int(s.obj)
222 __float__ = lambda s: float(s.obj)
223
224
225# we have to import it down here as the speedups and native

Callers 1

__mod__Method · 0.70

Calls 3

strFunction · 0.85
intFunction · 0.85
escapeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…