python version of 84.composite_set_preserved