Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove potentially dead code from make_simplified_union #15094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions mypy/typeops.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,6 @@ def _remove_redundant_union_items(items: list[Type], keep_erased: bool) -> list[
if safe_skip:
continue

# Keep track of the truthiness info for deleted subtypes which can be relevant
cbt = cbf = False
for j, tj in enumerate(items):
proper_tj = get_proper_type(tj)
if (
Expand All @@ -553,13 +551,6 @@ def _remove_redundant_union_items(items: list[Type], keep_erased: bool) -> list[
):
# We found a redundant item in the union.
removed.add(j)
cbt = cbt or tj.can_be_true
cbf = cbf or tj.can_be_false
# if deleted subtypes had more general truthiness, use that
if not item.can_be_true and cbt:
items[i] = true_or_false(item)
elif not item.can_be_false and cbf:
items[i] = true_or_false(item)

return [items[i] for i in range(len(items)) if i not in removed]

Expand Down