I prefer the set comprehension version you wrote in https://github.com/enthought/enstaller/pull/116/files#diff-3939c44292d853b5e0f49c5bdf87ccbaR238