def union((obj1, obj2)): result = SomeType() is_type_of1 = getattr(obj1, 'is_type_of', None) is_type_of2 = getattr(obj2, 'is_type_of', None) if obj1.is_immutable_constant() and obj2.is_immutable_constant() and obj1.const == obj2.const: result.const = obj1.const is_type_of = {} if is_type_of1: for v in is_type_of1: is_type_of[v] = True if is_type_of2: for v in is_type_of2: is_type_of[v] = True if is_type_of: result.is_type_of = is_type_of.keys() else: if is_type_of1 and is_type_of1 == is_type_of2: result.is_type_of = is_type_of1 return result
def union((obj1, obj2)): result = SomeType() is_type_of1 = getattr(obj1, 'is_type_of', None) is_type_of2 = getattr(obj2, 'is_type_of', None) if obj1.is_immutable_constant() and obj2.is_immutable_constant( ) and obj1.const == obj2.const: result.const = obj1.const is_type_of = {} if is_type_of1: for v in is_type_of1: is_type_of[v] = True if is_type_of2: for v in is_type_of2: is_type_of[v] = True if is_type_of: result.is_type_of = is_type_of.keys() else: if is_type_of1 and is_type_of1 == is_type_of2: result.is_type_of = is_type_of1 return result
def union((obj1, obj2)): result = SomeType() if obj1.is_immutable_constant() and obj2.is_immutable_constant( ) and obj1.const == obj2.const: result.const = obj1.const return result
def union((obj1, obj2)): result = SomeType() if obj1.is_immutable_constant() and obj2.is_immutable_constant() and obj1.const == obj2.const: result.const = obj1.const return result