MCPcopy Create free account
hub / github.com/ipython/ipython / as_hook

Function as_hook

IPython/core/page.py:46–51  ·  view source on GitHub ↗

Wrap a pager func to strip the `self` arg so it can be called as a hook.

(page_func)

Source from the content-addressed store, hash-verified

44
45
46def as_hook(page_func):
47 """Wrap a pager func to strip the `self` arg
48
49 so it can be called as a hook.
50 """
51 return lambda self, *args, **kwargs: page_func(*args, **kwargs)
52
53
54esc_re = re.compile(r"(\x1b[^m]+m)")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected