MCPcopy
hub / github.com/pallets/jinja / args_as_const

Function args_as_const

src/jinja2/nodes.py:718–736  ·  view source on GitHub ↗
(
    node: t.Union["_FilterTestCommon", "Call"], eval_ctx: t.Optional[EvalContext]
)

Source from the content-addressed store, hash-verified

716
717
718def args_as_const(
719 node: t.Union["_FilterTestCommon", "Call"], eval_ctx: t.Optional[EvalContext]
720) -> t.Tuple[t.List[t.Any], t.Dict[t.Any, t.Any]]:
721 args = [x.as_const(eval_ctx) for x in node.args]
722 kwargs = dict(x.as_const(eval_ctx) for x in node.kwargs)
723
724 if node.dyn_args is not None:
725 try:
726 args.extend(node.dyn_args.as_const(eval_ctx))
727 except Exception as e:
728 raise Impossible() from e
729
730 if node.dyn_kwargs is not None:
731 try:
732 kwargs.update(node.dyn_kwargs.as_const(eval_ctx))
733 except Exception as e:
734 raise Impossible() from e
735
736 return args, kwargs
737
738
739class _FilterTestCommon(Expr):

Callers 1

as_constMethod · 0.85

Calls 3

ImpossibleClass · 0.85
extendMethod · 0.80
as_constMethod · 0.45

Tested by

no test coverage detected