In the code:
import itertools
Q = [[factor(5),factor(13)],[factor(9),factor(7),factor(13)]]
print( sorted( Set( [lcm(*qq) for qq in itertools.product(*Q)] ) ) )
print( sorted( Set( (lcm(*qq) for qq in itertools.product(*Q)) ) ) )
first print
produces
[13, 5 * 7, 3^2 * 5, 5 * 13, 7 * 13, 3^2 * 13]
while second print
produces
[13, 5 * 7, 5 * 13, 7 * 13, 3^2 * 13]
Is this a bug?