How about this

    # transform to lowpass, bandpass, highpass, or bandstop
    if btype == 'lowpass':
        b, a = lp2lp(b, a, wo=warped)
    elif btype == 'highpass':
        b, a = lp2hp(b, a, wo=warped)
    elif btype == 'bandpass':
        bw = warped[1] - warped[0]
        wo = sqrt(warped[0] * warped[1])
        b, a = lp2bp(b, a, wo=wo, bw=bw)
    elif btype == 'bandstop':
        bw = warped[1] - warped[0]
        wo = sqrt(warped[0] * warped[1])
        b, a = lp2bs(b, a, wo=wo, bw=bw)
    else:
        raise NotImplementedError

the last would be reached if the string exists in filter_dict but iirfilter doesn't know how to handle it.  or should I just leave that out?