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

Function analyze_union_member_access

mypy/checkmember.py:501–508  ·  view source on GitHub ↗
(name: str, typ: UnionType, mx: MemberContext)

Source from the content-addressed store, hash-verified

499
500
501def analyze_union_member_access(name: str, typ: UnionType, mx: MemberContext) -> Type:
502 with mx.msg.disable_type_names():
503 results = []
504 for subtype in typ.relevant_items():
505 # Self types should be bound to every individual item of a union.
506 item_mx = mx.copy_modified(self_type=subtype)
507 results.append(_analyze_member_access(name, subtype, item_mx))
508 return make_simplified_union(results)
509
510
511def analyze_none_member_access(name: str, typ: NoneType, mx: MemberContext) -> Type:

Callers 1

_analyze_member_accessFunction · 0.85

Calls 6

make_simplified_unionFunction · 0.90
_analyze_member_accessFunction · 0.85
disable_type_namesMethod · 0.80
relevant_itemsMethod · 0.80
appendMethod · 0.80
copy_modifiedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…