class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface): (source)
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_array |
Undocumented |
Method | anal_star_arg_type |
Analyze signature argument type for *args and **kwargs argument. |
Method | anal_type |
Undocumented |
Method | anal_type_guard |
Undocumented |
Method | anal_type_guard_arg |
Undocumented |
Method | anal_var_def |
Undocumented |
Method | anal_var_defs |
Undocumented |
Method | analyze_callable_args |
Find types, kinds, and names of arguments from extended callable syntax. |
Method | analyze_callable_args_for_paramspec |
Construct a 'Callable[P, RET]', where P is ParamSpec, return None if we cannot. |
Method | analyze_callable_type |
Undocumented |
Method | analyze_literal_param |
Undocumented |
Method | analyze_literal_type |
Undocumented |
Method | analyze_type |
Analyze an unbound type using the default mypy logic. |
Method | analyze_type_with_type_info |
Bind unbound type when were able to find target TypeInfo. |
Method | analyze_unbound_type_without_type_info |
Figure out what an unbound type that doesn't refer to a TypeInfo node means. |
Method | bind_function_type_variables |
Find the type variables of the function type and bind them in our tvar_scope |
Method | cannot_resolve_type |
Undocumented |
Method | fail |
Emit an error message at given location. |
Method | get_omitted_any |
Undocumented |
Method | infer_type_variables |
Return list of unique type variables referred to in a callable. |
Method | is_defined_type_var |
Undocumented |
Method | named_type |
Construct an instance of a builtin type with given name. |
Method | named_type_with_normalized_str |
Does almost the same thing as named_type , except that we immediately unalias builtins.bytes and builtins.unicode to builtins.str as appropriate. |
Method | note |
Undocumented |
Method | try_analyze_special_unbound_type |
Bind special type that is recognized through magic name such as 'typing.Any'. |
Method | tuple_type |
Undocumented |
Method | tvar_scope_frame |
Undocumented |
Method | visit_any |
Undocumented |
Method | visit_callable_argument |
Undocumented |
Method | visit_callable_type |
Undocumented |
Method | visit_deleted_type |
Undocumented |
Method | visit_ellipsis_type |
Undocumented |
Method | visit_erased_type |
Undocumented |
Method | visit_instance |
Undocumented |
Method | visit_literal_type |
Undocumented |
Method | visit_none_type |
Undocumented |
Method | visit_overloaded |
Undocumented |
Method | visit_param_spec |
Undocumented |
Method | visit_partial_type |
Undocumented |
Method | visit_placeholder_type |
Undocumented |
Method | visit_raw_expression_type |
Undocumented |
Method | visit_star_type |
Undocumented |
Method | visit_tuple_type |
Undocumented |
Method | visit_type_alias_type |
Undocumented |
Method | visit_type_list |
Undocumented |
Method | visit_type_type |
Undocumented |
Method | visit_type_var |
Undocumented |
Method | visit_typeddict_type |
Undocumented |
Method | visit_unbound_type |
Undocumented |
Method | visit_unbound_type_nonoptional |
Undocumented |
Method | visit_uninhabited_type |
Undocumented |
Method | visit_union_type |
Undocumented |
Class Variable | global_scope |
Undocumented |
Class Variable | in_dynamic_func |
Undocumented |
Instance Variable | aliases_used |
Undocumented |
Instance Variable | allow_new_syntax |
Undocumented |
Instance Variable | allow_placeholder |
Undocumented |
Instance Variable | allow_required |
Undocumented |
Instance Variable | allow_tuple_literal |
Undocumented |
Instance Variable | allow_unbound_tvars |
Undocumented |
Instance Variable | api |
Undocumented |
Instance Variable | defining_alias |
Undocumented |
Instance Variable | fail_func |
Undocumented |
Instance Variable | is_typeshed_stub |
Undocumented |
Instance Variable | lookup_fqn_func |
Undocumented |
Instance Variable | lookup_qualified |
Undocumented |
Instance Variable | nesting_level |
Undocumented |
Instance Variable | note_func |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | plugin |
Undocumented |
Instance Variable | report_invalid_types |
Undocumented |
Instance Variable | tvar_scope |
Undocumented |
Undocumented
Parameters | |
api:SemanticAnalyzerCoreInterface | Undocumented |
tvar_scope:TypeVarLikeScope | Undocumented |
plugin:Plugin | Undocumented |
options:Options | Undocumented |
is_typeshed_stub:bool | Undocumented |
defining_alias:bool | Undocumented |
allow_tuple_literal:bool | Undocumented |
allow_new_syntax:bool | Undocumented |
allow_unbound_tvars:bool | Undocumented |
allow_placeholder:bool | Undocumented |
allow_required:bool | Undocumented |
report_invalid_types:bool | Undocumented |
Undocumented
Parameters | |
t:UnboundType | Undocumented |
fullname:str | Undocumented |
Returns | |
Optional[ | Undocumented |
Undocumented
Parameters | |
var_defs:Sequence[ | Undocumented |
Returns | |
List[ | Undocumented |
Parameters | |
callable_args:Type | Undocumented |
ret_type:Type | Undocumented |
fallback:Instance | Undocumented |
Returns | |
Optional[ | Undocumented |
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.
Parameters | |
t:UnboundType | Undocumented |
sym:SymbolTableNode | Undocumented |
defining_literal:bool | Undocumented |
Returns | |
Type | Undocumented |
Parameters | |
fun_type:CallableType | Undocumented |
defn:Context | Undocumented |
Returns | |
Sequence[ | Undocumented |
Parameters | |
type:CallableType | Undocumented |
Returns | |
List[ | Undocumented |
named_type
, except that we immediately
unalias builtins.bytes
and builtins.unicode
to builtins.str
as appropriate.Parameters | |
fully_qualified_name:str | Undocumented |
Returns | |
Instance | Undocumented |
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.
Parameters | |
t:UnboundType | Undocumented |
fullname:str | Undocumented |
Returns | |
Optional[ | Undocumented |
Undocumented
Parameters | |
t:UnboundType | Undocumented |
defining_literal:bool | Undocumented |
Returns | |
Type | Undocumented |
Undocumented
Parameters | |
t:UnboundType | Undocumented |
defining_literal:bool | Undocumented |
Returns | |
Type | Undocumented |