Extra Class APIs

Extra Class APIs#

The decree-tree.extras package includes several helper classes based on DecreeTree.

AbstractDT#

To simplify abstract class creation, use decree_tree.extras.AbstractDT. See Deconfliction for more details.

class decree_tree.extras.AbstractDT(*, name=None, inherit=True, prog_is_name=False, version=None)#

Bases: DecreeTree

A mixin for creating abstract classes, which attempts to avoid issues resulting from mixing abstract with manual inheritance.

Initialize the variables specific to the combined DecreeTree. This method exists to make its interface explicit, rather than relying on unspecified **kwargs.

Parameters:
  • name (str | None) – the command name, if overriding it for the instance

  • inherit (bool) – whether parents are considered when invoking a DecreeTree

  • prog_is_name (bool) – whether to use self.name as the program name in help

  • version (str | None) – version information; use --version to show