class documentation

class EnumCallAnalyzer: (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method build_enum_call_typeinfo Undocumented
Method check_enum_call Check if a call defines an Enum.
Method fail Undocumented
Method fail_enum_call_arg Undocumented
Method parse_enum_call_args Parse arguments of an Enum call.
Method process_enum_call Check if s defines an Enum; if yes, store the definition in symbol table.
Instance Variable api Undocumented
Instance Variable options Undocumented
def __init__(self, options: Options, api: SemanticAnalyzerInterface): (source)

Undocumented

def build_enum_call_typeinfo(self, name: str, items: list[str], fullname: str, line: int) -> TypeInfo: (source)

Undocumented

def check_enum_call(self, node: Expression, var_name: str, is_func_scope: bool) -> TypeInfo|None: (source)

Check if a call defines an Enum. Example: A = enum.Enum('A', 'foo bar') is equivalent to: class A(enum.Enum): foo = 1 bar = 2

def fail(self, msg: str, ctx: Context): (source)

Undocumented

def fail_enum_call_arg(self, message: str, context: Context) -> tuple[list[str], list[Expression|None], bool]: (source)

Undocumented

def parse_enum_call_args(self, call: CallExpr, class_name: str) -> tuple[list[str], list[Expression|None], bool]: (source)

Parse arguments of an Enum call. Return a tuple of fields, values, was there an error.

def process_enum_call(self, s: AssignmentStmt, is_func_scope: bool) -> bool: (source)

Check if s defines an Enum; if yes, store the definition in symbol table. Return True if this looks like an Enum definition (but maybe with errors), otherwise return False.

Undocumented

Undocumented