module documentation

Transform utilities (filters and decorator).

Function clear_inference_tip_cache Clear the inference tips cache.
Function inference_tip Given an instance specific inference function, return a function to be given to AstroidManager().register_transform to set this inference function.
Function _inference_tip_cached Cache decorator used for inference tips.
Variable _cache Undocumented
def clear_inference_tip_cache(): (source)

Clear the inference tips cache.

def inference_tip(infer_function: InferFn, raise_on_overwrite: bool = False) -> InferFn: (source)

Given an instance specific inference function, return a function to be given to AstroidManager().register_transform to set this inference function. :param bool raise_on_overwrite: Raise an `InferenceOverwriteError` if the inference tip will overwrite another. Used for debugging Typical usage .. sourcecode:: python AstroidManager().register_transform(Call, inference_tip(infer_named_tuple), predicate) .. Note:: Using an inference tip will override any previously set inference tip for the given node. Use a predicate in the transform to prevent excess overwrites.

@wrapt.decorator
def _inference_tip_cached(func: InferFn, instance: None, args: typing.Any, kwargs: typing.Any) -> Iterator[InferenceResult]: (source)

Cache decorator used for inference tips.