Skip to content

Commit 50afb03

Browse files
committed
Refactor: replace make_simplified_union with UnionType.make_union in checkmember.py (#8624)
This commit replaces all calls to make_simplified_union with UnionType.make_union in this file, as part of the codebase modernization effort in issue #8624.
1 parent f469a4c commit 50afb03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypy/checkmember.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _analyze_member_access(
258258
elif isinstance(typ, TypeVarLikeType):
259259
if isinstance(typ, TypeVarType) and typ.values:
260260
return _analyze_member_access(
261-
name, make_simplified_union(typ.values), mx, override_info
261+
name, UnionType.make_union(typ.values), mx, override_info
262262
)
263263
return _analyze_member_access(name, typ.upper_bound, mx, override_info)
264264
elif isinstance(typ, DeletedType):
@@ -486,7 +486,7 @@ def analyze_union_member_access(name: str, typ: UnionType, mx: MemberContext) ->
486486
# Self types should be bound to every individual item of a union.
487487
item_mx = mx.copy_modified(self_type=subtype)
488488
results.append(_analyze_member_access(name, subtype, item_mx))
489-
return make_simplified_union(results)
489+
return UnionType.make_union(results)
490490

491491

492492
def analyze_none_member_access(name: str, typ: NoneType, mx: MemberContext) -> Type:
@@ -668,7 +668,7 @@ def analyze_descriptor_access(descriptor_type: Type, mx: MemberContext) -> Type:
668668

669669
if isinstance(descriptor_type, UnionType):
670670
# Map the access over union types
671-
return make_simplified_union(
671+
return UnionType.make_union(
672672
[analyze_descriptor_access(typ, mx) for typ in descriptor_type.items]
673673
)
674674
elif not isinstance(descriptor_type, Instance):

0 commit comments

Comments
 (0)