col, col = col, col loses
List collections lose on this:
col(2), col(1) = col(1), col(2)
The collections package makes the assumption that a child will only be represented once in a collection, and as such fires 1 delete event too many here, orphaning one of the children in the ORM's bookkeeping while leaving it in the actual list. It's easy to see it here if the child has a backref to the parent- it'll be None after this assignment.
I think the approach here is to keep a refcount in the
CollectionAdapter and quash events while the membership count for a particular child is > 1. It would need to do bookkeeping based on the id() of the child to avoid conflicts with user comparison overrides.
Initially reported by maqr on the channel.