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

Function report_missing_attribute

mypy/checkmember.py:301–314  ·  view source on GitHub ↗
(
    original_type: Type,
    typ: Type,
    name: str,
    mx: MemberContext,
    override_info: TypeInfo | None = None,
)

Source from the content-addressed store, hash-verified

299
300
301def report_missing_attribute(
302 original_type: Type,
303 typ: Type,
304 name: str,
305 mx: MemberContext,
306 override_info: TypeInfo | None = None,
307) -> Type:
308 if mx.suppress_errors:
309 return AnyType(TypeOfAny.from_error)
310 error_code = mx.msg.has_no_attr(original_type, typ, name, mx.context, mx.module_symbol_table)
311 if not mx.msg.prefer_simple_messages():
312 if may_be_awaitable_attribute(name, typ, mx, override_info):
313 mx.msg.possible_missing_await(mx.context, error_code)
314 return AnyType(TypeOfAny.from_error)
315
316
317# The several functions that follow implement analyze_member_access for various

Callers 3

_analyze_member_accessFunction · 0.85

Calls 5

AnyTypeClass · 0.90
has_no_attrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…