I find this particular use of a generator difficult to read (it may be the code layout). Would a simple for loop over the cubes in other not suffice:
```python
for other_cube in self:
    other_dim_coord = other_cube.coord(dim_coord_name, dim_coords=True)
    if not a_cube_dim_coord.is_compatible(other_dim_coord):
        raise ValueError(...)