MCPcopy Index your code
hub / github.com/ipython/ipython / add_s

Method add_s

IPython/utils/strdispatch.py:29–34  ·  view source on GitHub ↗

Adds a target 'string' for dispatching

(self, s: str, obj: Callable, priority: int= 0 )

Source from the content-addressed store, hash-verified

27 self.regexs = {}
28
29 def add_s(self, s: str, obj: Callable, priority: int= 0 ):
30 """ Adds a target 'string' for dispatching """
31
32 chain = self.strs.get(s, CommandChainDispatcher())
33 chain.add(obj,priority)
34 self.strs[s] = chain
35
36 def add_re(self, regex, obj, priority= 0 ):
37 """ Adds a target regexp for dispatching """

Callers 1

set_hookMethod · 0.80

Calls 3

getMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected