arraylias.Alias.register_module#

Alias.register_module(module: module, lib: str | None = None, path: str | None = None, prefer: bool = False)[source]#

Register a module for looking up array functions.

Parameters:
  • module – A module, namespace, or class to look for attributes corresponding to the dispatched function name.

  • lib – Optional, a name string to identify the array library. If None this will be set as the base module name of the arrays module.

  • path – Optional, the path for the module. If empty this module will be added to the base path for the library.

  • prefer – Prioritize searching this module before previously registered modules for the current path (Default: False).

Note

The order modules with the same path are added sets the priority for looking up dispatched functions, with the first match in a module being returned.