neuralib.argp.dispatch.dispatch

neuralib.argp.dispatch.dispatch(command, alias=None, group=None)[source]

A decorator that mark a function a dispatch target function.

All functions decorated in same dispatch group should have save function signature (at least for non-default parameters). For example:

>>> @dispatch('A')
... def function_a(self, a, b, c=None):
...     pass
... @dispatch('B')
... def function_b(self, a, b, d=None):
...     pass
... def run_function(self):
...     invoke_command(self, 'A', a, b)
Parameters:
  • command (str)

  • alias (str | list[str] | None)

  • group (str | None)