def combine_types(x, y):
 if isinstance(x, Unknown):
  return y
 if isinstance(y, Unknown):
  return x
 if isinstance(x, Any):
  return x
 if isinstance(y, Any):
  return y
 if isinstance(x, Union):
  return combine_either(x, y)
 if isinstance(y, Union):
  return combine_either(y, x)
 if (x == y):
  return x
 return simplify_either([x], [y])

def combine_types ( x , y ) : if isinstance ( x , Unknown ) : return y if isinstance ( y , Unknown ) : return x if isinstance ( x , Any ) : return x if isinstance ( y , Any ) : return y if isinstance ( x , Union ) : return combine_either ( x , y ) if isinstance ( y , Union ) : return combine_either ( y , x ) if ( x == y ) : return x return simplify_either ( [ x ] , [ y ] )
perform a union of two types .