def maxtype(measure):
    measure = measure.measure
    isoption = isinstance(measure, Option)
    if isoption:
        measure = measure.ty
    if (not matches_typeset(measure, scalar) and
        not isinstance(measure, (Decimal, TimeDelta))):

        raise TypeError('measure must be numeric')

    if measure == bool_:
        result = bool_
    elif isinstance(measure, (Decimal, TimeDelta)):
        result = measure
    else:
        result = max(supertype(measure).types, key=lambda x: x.itemsize)
    return Option(result) if isoption else result
Get the maximum width for a particular numeric type
dataset/ETHPy150Open blaze/datashape/datashape/typesets.py/maxtype