def _more_generic(type1, type2):
    types = {_none_type: 0,
             _bool_type: 1,
             int: 2,
             float: 3,
             _binary_type: 4,
             _text_type: 5}
    invtypes = {5: _text_type,
                4: _binary_type,
                3: float,
                2: int,
                1: _bool_type,
                0: _none_type}
    moregeneric = max(types.get(type1, 5), types.get(type2, 5))
    return invtypes[moregeneric]