@staticmethod
PYL-R0201264 """
265 return not (attr.startswith("_") or is_internal_attribute(obj, attr))
266
267 def is_safe_callable(self, obj: t.Any) -> bool:268 """Check if an object is safely callable. By default callables
269 are considered safe unless decorated with :func:`unsafe`.
270
255 self.binop_table = self.default_binop_table.copy()
256 self.unop_table = self.default_unop_table.copy()
257
258 def is_safe_attribute(self, obj: t.Any, attr: str, value: t.Any) -> bool:259 """The sandboxed environment will call this method to check if the
260 attribute of an object is safe to access. Per default all attributes
261 starting with an underscore are considered private as well as the
467
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
480 """
481 raise Impossible()
482
483 def can_assign(self) -> bool: 484 """Check if it's possible to assign something to this node."""
485 return False
486
53 def _default_finalize(value: t.Any) -> t.Any:
54 return value
55
56 def _output_const_repr(self, group: t.Iterable[t.Any]) -> str: 57 return repr("".join([str(v) for v in group]))
58
59 def _output_child_to_const(
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.