Because there is still a very small amount of matter even in deep space (mostly hydrogen and helium), compression of space will effect the matter as P1V1/nRT1=P2V2/nRT2. This means the temperauture and pressure will change in relation to the change in volume such that P1T2/P2T1=V2/V1. If the volume change is very slow (relative to the rate transfer of thermal energy to the outside) and the thermal energy is transferred to/from the external environment, then you could have isothermal expansion/compression. In otherwords if T2 is allowed to remain the same as T1.