'Computes partial derivative of ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x, y
>>> Poly(x**2 + 2*x + 1, x).diff()
Poly(2*x + 2, x, domain=\'ZZ\')
>>> Poly(x*y**2 + x, x, y).diff((0, 0), (1, 1))
Poly(2*x*y, x, y, domain=\'ZZ\')'

def diff(f, *specs, **kwargs):

    if (not kwargs.get('evaluate', True)):
        return Derivative(f, *specs, **kwargs)
    if hasattr(f.rep, 'diff'):
        if (not specs):
            return f.per(f.rep.diff(m=1))
        rep = f.rep
        for spec in specs:
            if (type(spec) is tuple):
                (gen, m) = spec
            else:
                (gen, m) = (spec, 1)
            rep = rep.diff(int(m), f._gen_to_level(gen))
        return f.per(rep)
    else:
        raise OperationNotSupported(f, 'diff')
