class TypeAnalyser(SyntheticTypeVisitor[
Semantic analyzer for types. Converts unbound types into bound types. This is a no-op for already bound types. If an incomplete reference is encountered, this does a defer. The caller never needs to defer.
Method | __init__ |
Undocumented |
Method | anal |
Undocumented |
Method | anal |
Analyze signature argument type for *args and **kwargs argument. |
Method | anal |
Undocumented |
Method | anal |
Undocumented |
Method | anal |
Undocumented |
Method | anal |
Undocumented |
Method | anal |
Undocumented |
Method | analyze |
Find types, kinds, and names of arguments from extended callable syntax. |
Method | analyze |
Construct a 'Callable[C, RET]', where C is Concatenate[..., P], returning None if we cannot. |
Method | analyze |
Construct a 'Callable[P, RET]', where P is ParamSpec, return None if we cannot. |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | analyze |
Undocumented |
Method | analyze |
Analyze an unbound type using the default mypy logic. |
Method | analyze |
Bind unbound type when were able to find target TypeInfo. |
Method | analyze |
Figure out what an unbound type that doesn't refer to a TypeInfo node means. |
Method | apply |
Undocumented |
Method | bind |
Find the type variables of the function type and bind them in our tvar_scope |
Method | cannot |
Undocumented |
Method | check |
Undocumented |
Method | fail |
Emit an error message at given location. |
Method | find |
Undocumented |
Method | get |
Undocumented |
Method | infer |
Return list of unique type variables referred to in a callable. |
Method | is |
Undocumented |
Method | lookup |
Undocumented |
Method | lookup |
Undocumented |
Method | named |
Construct an instance of a builtin type with given name. |
Method | note |
Undocumented |
Method | pack |
Undocumented |
Method | try |
Bind special type that is recognized through magic name such as 'typing.Any'. |
Method | tuple |
Undocumented |
Method | tvar |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Method | visit |
Undocumented |
Class Variable | global |
Undocumented |
Class Variable | in |
Undocumented |
Instance Variable | aliases |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | allowed |
Undocumented |
Instance Variable | always |
Undocumented |
Instance Variable | api |
Undocumented |
Instance Variable | defining |
Undocumented |
Instance Variable | fail |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | nesting |
Undocumented |
Instance Variable | note |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | plugin |
Undocumented |
Instance Variable | prohibit |
Undocumented |
Instance Variable | report |
Undocumented |
Instance Variable | tvar |
Undocumented |
SemanticAnalyzerCoreInterface
, tvar_scope: TypeVarLikeScope
, plugin: Plugin
, options: Options
, is_typeshed_stub: bool
, *, defining_alias: bool
= False, allow_tuple_literal: bool
= False, allow_unbound_tvars: bool
= False, allow_placeholder: bool
= False, allow_required: bool
= False, allow_param_spec_literals: bool
= False, report_invalid_types: bool
= True, prohibit_self_type: str|None
= None, allowed_alias_tvars: list[ TypeVarLikeType]|None
= None, allow_type_any: bool
= False):
(source)
¶
Undocumented
Iterable[ Type]
, nested: bool
= True, *, allow_param_spec: bool
= False, allow_param_spec_literals: bool
= False) -> list[ Type]
:
(source)
¶
Undocumented
Type
, nested: bool
= True, *, allow_param_spec: bool
= False) -> Type
:
(source)
¶
Undocumented
TypeList
) -> tuple[ list[ Type], list[ ArgKind], list[ str|None]]|None
:
(source)
¶
Find types, kinds, and names of arguments from extended callable syntax.
Type
, ret_type: Type
, fallback: Instance
) -> CallableType|None
:
(source)
¶
Construct a 'Callable[C, RET]', where C is Concatenate[..., P], returning None if we cannot.
Type
, ret_type: Type
, fallback: Instance
) -> CallableType|None
:
(source)
¶
Construct a 'Callable[P, RET]', where P is ParamSpec, return None if we cannot.
TypeInfo
, args: Sequence[ Type]
, ctx: Context
) -> Type
:
(source)
¶
Bind unbound type when were able to find target TypeInfo. This handles simple cases like 'int', 'modname.UserClass[str]', etc.
UnboundType
, sym: SymbolTableNode
, defining_literal: bool
) -> Type
:
(source)
¶
Figure out what an unbound type that doesn't refer to a TypeInfo node means. This is something unusual. We try our best to find out what it is.
CallableType
, defn: Context
) -> tuple[ Sequence[ TypeVarLikeType], bool]
:
(source)
¶
Find the type variables of the function type and bind them in our tvar_scope
Type
, include_callables: bool
= True) -> TypeVarLikeList
:
(source)
¶
Undocumented
str
, ctx: Context
, suppress_errors: bool
= False) -> SymbolTableNode|None
:
(source)
¶
Undocumented
str
, args: list[ Type]|None
= None, line: int
= -1, column: int
= -1) -> Instance
:
(source)
¶
Construct an instance of a builtin type with given name.
Bind special type that is recognized through magic name such as 'typing.Any'. Return the bound type if successful, and return None if the type is a normal type.
UnboundType
, defining_literal: bool
) -> Type
:
(source)
¶
Undocumented