argdigest.AliasTable#

class argdigest.AliasTable(aliases, applies_to='*', when=None, description=None)[source]#

A set of argument-name aliases, optionally scoped to callers and to a context.

applies_to is an exact caller, an fnmatch pattern, or “*” for every caller.

when guards the table on the value of another argument of the same call, which is what covers a name whose meaning depends on context: name means atom_name when element=”atom”. It is an equality test against already-bound arguments, not an expression language.

Parameters:
  • aliases (Mapping[str, str])

  • applies_to (str)

  • when (Mapping[str, Any] | None)

  • description (str | None)

__init__(aliases, applies_to='*', when=None, description=None)#
Parameters:
  • aliases (Mapping[str, str])

  • applies_to (str)

  • when (Mapping[str, Any] | None)

  • description (str | None)

Return type:

None

Methods

__init__(aliases[, applies_to, when, ...])

matches_caller(caller)

matches_context(bound)

Attributes

applies_to

description

specificity

an exact caller beats a longer pattern beats *.

when

aliases