'Apply ``_hasattrs`` and ``_hastypes`` to ``expr``.'

def _has(self, expr, attrs, types):

    if (not (attrs or types)):
        return True
    if (attrs and self._hasattrs(expr, attrs)):
        return True
    if (types and self._hastypes(expr, types)):
        return True
    return False
