@@ -337,7 +337,6 @@ def is_simple_literal(t: ProperType) -> bool:
337
337
338
338
339
339
def make_simplified_union (items : Sequence [Type ],
340
- line : int = - 1 , column : int = - 1 ,
341
340
* , keep_erased : bool = False ,
342
341
contract_literals : bool = True ) -> ProperType :
343
342
"""Build union type with redundant union items removed.
@@ -381,7 +380,7 @@ def make_simplified_union(items: Sequence[Type],
381
380
if contract_literals and sum (isinstance (item , LiteralType ) for item in simplified_set ) > 1 :
382
381
simplified_set = try_contracting_literals_in_union (simplified_set )
383
382
384
- return UnionType .make_union (simplified_set , line , column )
383
+ return UnionType .make_union (simplified_set )
385
384
386
385
387
386
def _remove_redundant_union_items (items : List [ProperType ], keep_erased : bool ) -> List [ProperType ]:
@@ -479,7 +478,7 @@ def true_only(t: Type) -> ProperType:
479
478
# The true version of a union type is the union of the true versions of its components
480
479
new_items = [true_only (item ) for item in t .items ]
481
480
can_be_true_items = [item for item in new_items if item .can_be_true ]
482
- return make_simplified_union (can_be_true_items , line = t . line , column = t . column )
481
+ return make_simplified_union (can_be_true_items )
483
482
else :
484
483
ret_type = _get_type_special_method_bool_ret_type (t )
485
484
@@ -514,7 +513,7 @@ def false_only(t: Type) -> ProperType:
514
513
# The false version of a union type is the union of the false versions of its components
515
514
new_items = [false_only (item ) for item in t .items ]
516
515
can_be_false_items = [item for item in new_items if item .can_be_false ]
517
- return make_simplified_union (can_be_false_items , line = t . line , column = t . column )
516
+ return make_simplified_union (can_be_false_items )
518
517
else :
519
518
ret_type = _get_type_special_method_bool_ret_type (t )
520
519
@@ -536,7 +535,7 @@ def true_or_false(t: Type) -> ProperType:
536
535
537
536
if isinstance (t , UnionType ):
538
537
new_items = [true_or_false (item ) for item in t .items ]
539
- return make_simplified_union (new_items , line = t . line , column = t . column )
538
+ return make_simplified_union (new_items )
540
539
541
540
new_t = copy_type (t )
542
541
new_t .can_be_true = new_t .can_be_true_default ()
0 commit comments