module documentation

Various context related utilities, including inference and call contexts.

Class CallContext Holds information for a call site.
Class InferenceContext Provide context for inference
Function bind_context_to_node Give a context a boundnode to retrieve the correct function name or attribute value with from further inference.
Function copy_context Clone a context if given, or return a fresh contexxt
Function _invalidate_cache Undocumented
Constant _INFERENCE_CACHE Undocumented
def bind_context_to_node(context, node): (source)

Give a context a boundnode to retrieve the correct function name or attribute value with from further inference.

Do not use an existing context since the boundnode could then be incorrectly propagated higher up in the call stack.

Parameters
context:Optional(context)Context to use
nodeNode to do name lookups from
node NodeNG:Undocumented
Returns
InferenceContextA new context
def copy_context(context: InferenceContext | None) -> InferenceContext: (source)

Clone a context if given, or return a fresh contexxt

def _invalidate_cache(): (source)

Undocumented

_INFERENCE_CACHE: dict = (source)

Undocumented

Value
{}