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

Method add_re

IPython/utils/strdispatch.py:35–40  ·  view source on GitHub ↗

Adds a target regexp for dispatching

(self, regex, obj, priority= 0 )

Source from the content-addressed store, hash-verified

33 self.strs[s] = chain
34
35 def add_re(self, regex, obj, priority= 0 ):
36 """ Adds a target regexp for dispatching """
37
38 chain = self.regexs.get(regex, CommandChainDispatcher())
39 chain.add(obj,priority)
40 self.regexs[regex] = chain
41
42 def dispatch(self, key):
43 """ Get a seq of Commandchain objects that match key """

Callers 2

set_hookMethod · 0.80

Calls 2

addMethod · 0.45

Tested by 1