You can use `any()` here, instead of `len(filter(...)) > 0`.