print([o.name for o in bpy.context.selected_objects])
temp_selected_objects = [...]
with bpy.context.temp_override(selected_objects=temp_selected_objects):
bpy.ops.object.duplicate(linked=True)
print([o.name for o in bpy.context.selected_objects])
I would expect the 2 prints to output the same, however after ‘bpy.ops.object.duplicate’ which changes the selection to the new duplicates, it appears to overwrite the original context.selected_objects, despite being scoped in a temp_override call.
It would be useful for my purposes so it remembered the original selection once outside of the ‘with’ scope, which is easily doable… but I’m just wondering why does it do that?