# Deleting an object part of a collection does not remove it from the collection

Video to the question: https://youtu.be/kgvwxt84Rkg

After deleting an object which is part of a collection it seems the collection still contains the deleted object (which i did not expect). Especially problematic for me is that I can't find a way to fix this. I discovered the problem way to late to undo the deletion and I don't know how to modify the collection directly.

import bpy

Afterward I found out I could have done the same via Select Linked (Shift+L) \ Instanced Collection and editing the property while holding Alt (to apply it to all selected objects).