bundles / traitlets latest / traitlets / config / loader / ArgParseConfigLoader / __init__
function
traitlets.config.loader:ArgParseConfigLoader.__init__
source: /traitlets/config/loader.py:815
Signature
def __init__(self, argv: list[str] | None = None, aliases: dict[str, str] | None = None, flags: dict[str, str] | None = None, log: t.Any = None, classes: list[type[t.Any]] | None = None, subcommands: SubcommandsDict | None = None, *parser_args: t.Any, **parser_kw: t.Any) → NoneSummary
Create a config loader for use with argparse.
Parameters
classes: optional, listThe classes to scan for container config-traits and decide for their "multiplicity" when adding them as argparse arguments.
argv: optional, listIf given, used to read command-line arguments from, otherwise sys.argv[1:] is used.
*parser_args: tupleA tuple of positional arguments that will be passed to the constructor of argparse.ArgumentParser.
**parser_kw: dictA tuple of keyword arguments that will be passed to the constructor of argparse.ArgumentParser.
aliases: dict of str to strDict of aliases to full traitlets names for CLI parsing
flags: dict of str to strDict of flags to full traitlets names for CLI parsing
logPassed to ConfigLoader
Aliases
traitlets.config.loader.ArgParseConfigLoader.__init__