module documentation
(source)

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.
Variable ​Infer​Fn Undocumented
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, raise_on_overwrite=False): (source)

Given an instance specific inference function, return a function to be given to AstroidManager().register_transform to set this inference function.

Typical usage

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.

Parameters
infer​_function:InferFnUndocumented
raise​_on​_overwrite:boolUndocumented
bool raise​_on​_overwriteRaise an InferenceOverwriteError if the inference tip will overwrite another. Used for debugging
Returns
InferFnUndocumented
InferFn = (source)

Undocumented

@wrapt.decorator
def _inference_tip_cached(func, instance, args, kwargs): (source)
Cache decorator used for inference tips
_cache: typing.Dict[typing.Tuple[InferFn, NodeNG], typing.Any] = (source)

Undocumented