gootsaud / bike-riding

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
2 years ago2 years old
Method doesn't use the class instance and could be converted into a static method
264        """
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
Method doesn't use the class instance and could be converted into a static method
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
Method doesn't use the class instance and could be converted into a static method
 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
Method doesn't use the class instance and could be converted into a static method
 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
Method doesn't use the class instance and could be converted into a static method
 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(