From 67ebbdcfa5bb7cce693c16ac14e68ff4f5f6c858 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Fri, 21 Apr 2023 01:20:33 -0600 Subject: [PATCH] Remove potentially dead code from make_simplified_union --- mypy/typeops.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mypy/typeops.py b/mypy/typeops.py index 8ed59b6fbe55..a63c446550db 100644 --- a/mypy/typeops.py +++ b/mypy/typeops.py @@ -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 ( @@ -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]