'A tuple containing leading degrees in all variables.
Note that the degree of 0 is negative infinity (the SymPy object -oo)'

def degrees(f):

    if (not f):
        return (((- oo),) * f.ring.ngens)
    else:
        return tuple(map(max, list(zip(*f.itermonoms()))))
