parsing module¶
Utilities for parsing.
ann_args_to_args function¶
Convert annotated arguments back to positional and keyword arguments.
annotate_args function¶
annotate_args(
func,
args,
kwargs,
only_passed=False,
allow_partial=False,
attach_annotations=False,
flatten=False
)
Annotate arguments and keyword arguments using the function's signature.
If allow_partial is True, required arguments that weren't provided won't raise an error. But regardless of allow_partial, arguments that aren't in the signature will still raise an error.
extend_args function¶
Extend arguments and keyword arguments with other arguments.
flat_ann_args_to_args function¶
Convert flattened annotated arguments back to positional and keyword arguments.
flatten_ann_args function¶
Flatten annotated arguments.
get_context_vars function¶
Get variables from the local/global context.
get_expr_var_names function¶
Get variable names listed in the expression.
get_func_arg_names function¶
Get argument names of a function.
get_func_kwargs function¶
Get keyword arguments with defaults of a function.
hash_args function¶
Get hash of arguments.
Use ignore_args to provide a sequence of queries for arguments that should be ignored.
ignore_flat_ann_args function¶
Ignore flattened annotated arguments.
match_and_set_flat_ann_arg function¶
Match an argument from flattened annotated arguments and set it to a new value.
See match_flat_ann_arg() for matching logic.
match_ann_arg function¶
Match an argument from annotated arguments.
See match_flat_ann_arg() for matching logic.
match_flat_ann_arg function¶
Match an argument from flattened annotated arguments.
A query can be an integer indicating the position of the argument, or a string containing the name of the argument, or a regular expression for matching the name of the argument.
If multiple arguments were matched, returns the first one.
The position can stretch over any variable argument.
suppress_stdout function¶
Suppress output from a function.
unflatten_ann_args function¶
Unflatten annotated arguments.
warn_stdout function¶
Supress and convert to a warning output from a function.
PrintsSuppressed class¶
Context manager to ignore print statements.
Superclasses
abc.ABCcontextlib.AbstractContextManagercontextlib._RedirectStreamcontextlib.redirect_stdout
Regex class¶
Class for matching a regular expression.
Superclasses
Inherited members
- DefineMixin.asdict()
- DefineMixin.assert_field_not_missing()
- DefineMixin.get_field()
- DefineMixin.hash
- DefineMixin.hash_key
- DefineMixin.is_field_missing()
- DefineMixin.is_field_optional()
- DefineMixin.is_field_required()
- DefineMixin.merge_over()
- DefineMixin.merge_with()
- DefineMixin.replace()
- DefineMixin.resolve()
- DefineMixin.resolve_field()
- Hashable.get_hash()
flags class variable¶
Flags.
matches method¶
Return whether the string matches the regular expression pattern.
pattern class variable¶
Pattern.
UnhashableArgsError class¶
Unhashable arguments error.
Superclasses
builtins.BaseExceptionbuiltins.Exception
WarningsFiltered class¶
Context manager to ignore warnings.
Specify whether to record warnings and if an alternative module should be used other than sys.modules['warnings'].
For compatibility with Python 3.0, please consider all arguments to be keyword-only.
Superclasses
warnings.catch_warnings
entries property¶
One or more simple entries to add into the list of warnings filters.