def type_promotion(t1, t2):
    if t2 == None:
        return t1
    t1 = _super_types.get(t1, t1)
    t2 = _super_types.get(t2, t2)
    if t1 == t2:
        return t1  # matching super-types
    try:
        return _typePromotionMap[t1][t2]
    except __HOLE__:
        raise TypeError(
            'Operators cannot combine datatypes %s and %s' % (t1, t2))
dataset/ETHPy150Open RDFLib/rdflib/rdflib/plugins/sparql/datatypes.py/type_promotion