module documentation

Astroid hooks for the Python standard library.

Function infer_enum Specific inference function for enum Call node.
Function infer_enum_class Specific inference for enums.
Function infer_func_form Specific inference function for namedtuple or Python 3 enum.
Function infer_named_tuple Specific inference function for namedtuple Call node
Function infer_typing_namedtuple Infer a typing.NamedTuple(...) call.
Function infer_typing_namedtuple_class Infer a subclass of typing.NamedTuple
Function infer_typing_namedtuple_function Starting with python3.9, NamedTuple is a function of the typing module. The class NamedTuple is build dynamically through a call to type during initialization of the _NamedTuple variable.
Constant ENUM_BASE_NAMES Undocumented
Constant INT_FLAG_ADDITION_METHODS Undocumented
Constant TYPING_NAMEDTUPLE_BASENAMES Undocumented
Function _check_namedtuple_attributes Undocumented
Function _find_func_form_arguments Undocumented
Function _get_renamed_namedtuple_attributes Undocumented
Function _has_namedtuple_base Predicate for class inference tip
Function _infer_first Undocumented
Function _is_enum_subclass Return whether cls is a subclass of an Enum.
Function _looks_like Undocumented
Variable _looks_like_enum Undocumented
Variable _looks_like_namedtuple Undocumented
Variable _looks_like_typing_namedtuple Undocumented
def infer_enum(node, context=None): (source)

Specific inference function for enum Call node.

def infer_enum_class(node): (source)

Specific inference for enums.

def infer_func_form(node, base_type, context=None, enum=False): (source)

Specific inference function for namedtuple or Python 3 enum.

def infer_named_tuple(node, context=None): (source)

Specific inference function for namedtuple Call node

def infer_typing_namedtuple(node, context=None): (source)

Infer a typing.NamedTuple(...) call.

def infer_typing_namedtuple_class(class_node, context=None): (source)

Infer a subclass of typing.NamedTuple

def infer_typing_namedtuple_function(node, context=None): (source)

Starting with python3.9, NamedTuple is a function of the typing module. The class NamedTuple is build dynamically through a call to type during initialization of the _NamedTuple variable.

ENUM_BASE_NAMES: set[str] = (source)

Undocumented

Value
set(['Enum', 'IntEnum', 'enum.Enum', 'enum.IntEnum', 'IntFlag', 'enum.IntFlag'])
INT_FLAG_ADDITION_METHODS: str = (source)

Undocumented

Value
'''
    def __or__(self, other):
        return {name}(self.value | other.value)
    def __and__(self, other):
        return {name}(self.value & other.value)
    def __xor__(self, other):
        return {name}(self.value ^ other.value)
...
TYPING_NAMEDTUPLE_BASENAMES: set[str] = (source)

Undocumented

Value
set(['NamedTuple', 'typing.NamedTuple'])
def _check_namedtuple_attributes(typename, attributes, rename=False): (source)

Undocumented

def _find_func_form_arguments(node, context): (source)

Undocumented

def _get_renamed_namedtuple_attributes(field_names): (source)

Undocumented

def _has_namedtuple_base(node): (source)

Predicate for class inference tip

Parameters
node:ClassDefUndocumented
Returns
boolUndocumented
def _infer_first(node, context): (source)

Undocumented

def _is_enum_subclass(cls: astroid.ClassDef) -> bool: (source)

Return whether cls is a subclass of an Enum.

def _looks_like(node, name): (source)

Undocumented

_looks_like_enum = (source)

Undocumented

_looks_like_namedtuple = (source)

Undocumented

_looks_like_typing_namedtuple = (source)

Undocumented