MCPcopy Index your code
hub / github.com/python/mypy / type_analyzer

Method type_analyzer

mypy/semanal.py:7761–7800  ·  view source on GitHub ↗
(
        self,
        *,
        tvar_scope: TypeVarLikeScope | None = None,
        allow_tuple_literal: bool = False,
        allow_unbound_tvars: bool = False,
        allow_placeholder: bool = False,
        allow_typed_dict_special_forms: bool = False,
        allow_final: bool = False,
        allow_param_spec_literals: bool = False,
        allow_unpack: bool = False,
        report_invalid_types: bool = True,
        prohibit_self_type: str | None = None,
        prohibit_special_class_field_types: str | None = None,
        allow_type_any: bool = False,
    )

Source from the content-addressed store, hash-verified

7759 expr.accept(self)
7760
7761 def type_analyzer(
7762 self,
7763 *,
7764 tvar_scope: TypeVarLikeScope | None = None,
7765 allow_tuple_literal: bool = False,
7766 allow_unbound_tvars: bool = False,
7767 allow_placeholder: bool = False,
7768 allow_typed_dict_special_forms: bool = False,
7769 allow_final: bool = False,
7770 allow_param_spec_literals: bool = False,
7771 allow_unpack: bool = False,
7772 report_invalid_types: bool = True,
7773 prohibit_self_type: str | None = None,
7774 prohibit_special_class_field_types: str | None = None,
7775 allow_type_any: bool = False,
7776 ) -> TypeAnalyser:
7777 if tvar_scope is None:
7778 tvar_scope = self.tvar_scope
7779 tpan = TypeAnalyser(
7780 self,
7781 tvar_scope,
7782 self.plugin,
7783 self.options,
7784 self.cur_mod_node,
7785 self.is_typeshed_stub_file,
7786 allow_unbound_tvars=allow_unbound_tvars,
7787 allow_tuple_literal=allow_tuple_literal,
7788 report_invalid_types=report_invalid_types,
7789 allow_placeholder=allow_placeholder,
7790 allow_typed_dict_special_forms=allow_typed_dict_special_forms,
7791 allow_final=allow_final,
7792 allow_param_spec_literals=allow_param_spec_literals,
7793 allow_unpack=allow_unpack,
7794 prohibit_self_type=prohibit_self_type,
7795 prohibit_special_class_field_types=prohibit_special_class_field_types,
7796 allow_type_any=allow_type_any,
7797 )
7798 tpan.in_dynamic_func = bool(self.function_stack and self.function_stack[-1].is_dynamic())
7799 tpan.global_scope = not self.type and not self.function_stack
7800 return tpan
7801
7802 def expr_to_unanalyzed_type(self, node: Expression, allow_unpack: bool = False) -> ProperType:
7803 return expr_to_unanalyzed_type(

Callers 5

analyze_func_defMethod · 0.95
analyze_function_bodyMethod · 0.95
anal_typeMethod · 0.95

Calls 3

TypeAnalyserClass · 0.90
boolClass · 0.85
is_dynamicMethod · 0.45

Tested by

no test coverage detected