class documentation

class SemanticAnalyzerInterface(SemanticAnalyzerCoreInterface): (source)

Known subclasses: mypy.semanal.SemanticAnalyzer

View In Hierarchy

A limited abstract interface to some generic semantic analyzer pass 2 functionality. We use this interface for various reasons: * Looser coupling * Cleaner import graph * Less need to pass around callback functions

Method accept Undocumented
Method add_symbol Add symbol to the current symbol table.
Method add_symbol_skip_local Add symbol to the current symbol table, skipping locals.
Method add_symbol_table_node Add node to the current symbol table.
Method anal_type Undocumented
Method basic_new_typeinfo Undocumented
Method current_symbol_table Get currently active symbol table.
Method get_and_bind_all_tvars Undocumented
Method lookup Undocumented
Method named_type Undocumented
Method named_type_or_none Undocumented
Method parse_bool Undocumented
Method process_placeholder Undocumented
Method qualified_name Undocumented
Method schedule_patch Undocumented
Class Variable tvar_scope Undocumented
Property is_typeshed_stub_file Undocumented

Inherited from SemanticAnalyzerCoreInterface:

Method defer Undocumented
Method fail Undocumented
Method incomplete_feature_enabled Undocumented
Method is_func_scope Undocumented
Method is_future_flag_set Is the specific __future__ feature imported
Method is_incomplete_namespace Is a module or class namespace potentially missing some definitions?
Method lookup_fully_qualified Undocumented
Method lookup_fully_qualified_or_none Undocumented
Method lookup_qualified Undocumented
Method note Undocumented
Method record_incomplete_ref Undocumented
Property final_iteration Is this the final iteration of semantic analysis?
Property is_stub_file Undocumented
Property type Undocumented
@abstractmethod
def accept(self, node: Node): (source)

Undocumented

@abstractmethod
def add_symbol(self, name: str, node: SymbolNode, context: Context, module_public: bool = True, module_hidden: bool = False, can_defer: bool = True) -> bool: (source)

Add symbol to the current symbol table.

@abstractmethod
def add_symbol_skip_local(self, name: str, node: SymbolNode): (source)

Add symbol to the current symbol table, skipping locals. This is used to store symbol nodes in a symbol table that is going to be serialized (local namespaces are not serialized). See implementation docstring for more details.

@abstractmethod
def add_symbol_table_node(self, name: str, stnode: SymbolTableNode) -> bool: (source)

Add node to the current symbol table.

@abstractmethod
def anal_type(self, t: Type, *, tvar_scope: TypeVarLikeScope|None = None, allow_tuple_literal: bool = False, allow_unbound_tvars: bool = False, allow_required: bool = False, allow_placeholder: bool = False, report_invalid_types: bool = True, prohibit_self_type: str|None = None) -> Type|None: (source)

Undocumented

@abstractmethod
def basic_new_typeinfo(self, name: str, basetype_or_fallback: Instance, line: int) -> TypeInfo: (source)

Undocumented

@abstractmethod
def current_symbol_table(self) -> SymbolTable: (source)

Get currently active symbol table. May be module, class, or local namespace.

@abstractmethod
def get_and_bind_all_tvars(self, type_exprs: list[Expression]) -> list[TypeVarLikeType]: (source)

Undocumented

@abstractmethod
def lookup(self, name: str, ctx: Context, suppress_errors: bool = False) -> SymbolTableNode|None: (source)

Undocumented

@abstractmethod
def named_type(self, fullname: str, args: list[Type]|None = None) -> Instance: (source)

Undocumented

@abstractmethod
def named_type_or_none(self, fullname: str, args: list[Type]|None = None) -> Instance|None: (source)

Undocumented

@abstractmethod
def parse_bool(self, expr: Expression) -> bool|None: (source)

Undocumented

@abstractmethod
def process_placeholder(self, name: str|None, kind: str, ctx: Context, force_progress: bool = False): (source)

Undocumented

@abstractmethod
def qualified_name(self, n: str) -> str: (source)

Undocumented

@abstractmethod
def schedule_patch(self, priority: int, fn: Callable[[], None]): (source)

Undocumented

@property
@abstractmethod
is_typeshed_stub_file: bool = (source)

Undocumented