def union((r1, r2)): if r1.ootype is None: common = r2.ootype elif r2.ootype is None: common = r1.ootype else: common = ootype.commonBaseclass(r1.ootype, r2.ootype) assert common is not None, ('Mixing of incompatible classes %r, %r' % (r1.ootype, r2.ootype)) return SomeOOClass(common)
def union((r1, r2)): if r1.ootype is None: common = r2.ootype elif r2.ootype is None: common = r1.ootype elif r1.ootype == r2.ootype: common = r1.ootype elif isinstance(r1.ootype, ootype.Instance) and isinstance(r2.ootype, ootype.Instance): common = ootype.commonBaseclass(r1.ootype, r2.ootype) assert common is not None, ('Mixing of incompatible classes %r, %r' % (r1.ootype, r2.ootype)) else: common = ootype.Object return SomeOOClass(common)
def union((r1, r2)): if r1.ootype is None: common = r2.ootype elif r2.ootype is None: common = r1.ootype elif r1.ootype == r2.ootype: common = r1.ootype elif isinstance(r1.ootype, ootype.Instance) and isinstance( r2.ootype, ootype.Instance): common = ootype.commonBaseclass(r1.ootype, r2.ootype) assert common is not None, ( 'Mixing of incompatible classes %r, %r' % (r1.ootype, r2.ootype)) else: common = ootype.Object return SomeOOClass(common)
def union((r1, r2)): common = ootype.commonBaseclass(r1.ootype, r2.ootype) assert common is not None, 'Mixing of incompatible instances %r, %r' %(r1.ootype, r2.ootype) return SomeOOInstance(common, can_be_None=r1.can_be_None or r2.can_be_None)
def union((r1, r2)): common = ootype.commonBaseclass(r1.ootype, r2.ootype) assert common is not None, 'Mixing of incompatible instances %r, %r' % ( r1.ootype, r2.ootype) return SomeOOInstance(common, can_be_None=r1.can_be_None or r2.can_be_None)