human
I wrote the below code

    assert (iterations > 0)
    if (not digest):
        digest = hashlib.sha256
    hlen = digest().digest_size
    if (not dklen):
        dklen = hlen
    if (dklen > (((2 ** 32) - 1) * hlen)):
        raise OverflowError('dklen    too    big')
    l = (- ((- dklen) // hlen))
    r = (dklen - ((l - 1) * hlen))
    hex_format_string = ('%%0%ix' % (hlen * 2))
    def F(i):
        def U():
            u = (salt + struct.pack('>I', i))
            for j in xrange(int(iterations)):
                u = _fast_hmac(password, u, digest).digest()
                (yield _bin_to_long(u))
        return _long_to_bin(reduce(operator.xor, U()), hex_format_string)
    T = [F(x) for x in range(1, (l + 1))]
    return (''.join(T[:(-1)]) + T[(-1)][:r])

What's a good function header?
assistant
#Here's a good function header.

def pbkdf2(password, salt, iterations, dklen=0, digest=None):