GitHub

API reference for Param.

class Param[A]

A tree of params parsing an A.

Attributes

AttributeTypeDescription
kindKind

Functions

parse

parse(args) -> Parsed[A]
ParameterTypeDescription
argsParsedArgs

Returns Parsed[A]

@abstractmethod
def parse(self, args: ParsedArgs) -> Parsed[A]: ...

map_singles

map_singles(f) -> Param[A]

This tree with every Single in it replaced by f's.

ParameterTypeDescription
fCallable[[Single[Any]], Single[Any]]

Returns Param[A]

@abstractmethod
def map_singles(self, f: Callable[[Single[Any]], Single[Any]]) -> Param[A]:
    """This tree with every ``Single`` in it replaced by ``f``'s."""

singles

singles() -> list[Single[Any]]

Every Single in the tree, alternatives included, in order.

Returns list[Single[Any]]

@abstractmethod
def singles(self) -> list[Single[Any]]:
    """Every ``Single`` in the tree, alternatives included, in order."""

metadata

metadata() -> ParamMetadata

Whether the tree is optional or variadic, and its bounds.

Returns ParamMetadata

@abstractmethod
def metadata(self) -> ParamMetadata:
    """Whether the tree is optional or variadic, and its bounds."""