rope.base.utils =============== .. py:module:: rope.base.utils Submodules ---------- .. toctree:: :maxdepth: 1 /api/rope/base/utils/datastructures/index Attributes ---------- .. autoapisummary:: rope.base.utils.cacheit Functions --------- .. autoapisummary:: rope.base.utils.saveit rope.base.utils.prevent_recursion rope.base.utils.ignore_exception rope.base.utils.deprecated rope.base.utils.cached rope.base.utils.resolve rope.base.utils.guess_def_lineno Package Contents ---------------- .. py:function:: saveit(func) A decorator that caches the return value of a function .. py:data:: cacheit .. py:function:: prevent_recursion(default) A decorator that returns the return value of `default` in recursions .. py:function:: ignore_exception(exception_class) A decorator that ignores `exception_class` exceptions .. py:function:: deprecated(message=None) A decorator for deprecated functions .. py:function:: cached(size) A caching decorator based on parameter objects .. py:function:: resolve(str_or_obj) Returns object from string .. py:function:: guess_def_lineno(module, node) Find the line number for a function or class definition. `node` may be either an ast.FunctionDef, ast.AsyncFunctionDef, or ast.ClassDef Python 3.8 simply provides this to us, but in earlier versions the ast node.lineno points to the first decorator rather than the actual definition, so we try our best to find where the definitions are. This is to workaround bpo-33211 (https://bugs.python.org/issue33211)