{ } Raw JSON

bundles / IPython 9.13.0 / IPython / utils / strdispatch / StrDispatch

class

IPython.utils.strdispatch:StrDispatch

source: /IPython/utils/strdispatch.py :12

Signature

class   StrDispatch ( )

Members

Summary

Dispatch (lookup) a set of strings / regexps for match.

Extended Summary

Example:

>>> dis = StrDispatch()
>>> dis.add_s('hei',34, priority = 4)
>>> dis.add_s('hei',123, priority = 2)
>>> dis.add_re('h.i', 686)
>>> print(list(dis.flat_matches('hei')))
[123, 34, 686]

Aliases

  • IPython.core.interactiveshell.StrDispatch