MCPcopy Create free account
hub / github.com/nodejs/node / as_const

Method as_const

deps/v8/third_party/jinja2/nodes.py:470–481  ·  view source on GitHub ↗

Return the value of the expression as constant or raise :exc:`Impossible` if this was not possible. An :class:`EvalContext` can be provided, if none is given a default context is created which requires the nodes to have an attached environment. .. versioncha

(self, eval_ctx: t.Optional[EvalContext] = None)

Source from the content-addressed store, hash-verified

468 abstract = True
469
470 def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
471 """Return the value of the expression as constant or raise
472 :exc:`Impossible` if this was not possible.
473
474 An :class:`EvalContext` can be provided, if none is given
475 a default context is created which requires the nodes to have
476 an attached environment.
477
478 .. versionchanged:: 2.4
479 the `eval_ctx` parameter was added.
480 """
481 raise Impossible()
482
483 def can_assign(self) -> bool:
484 """Check if it's possible to assign something to this node."""

Callers

nothing calls this directly

Calls 1

ImpossibleClass · 0.70

Tested by

no test coverage detected