def _set_iterable(self, state, dict_, iterable, adapter=None):
        new_values = list(iterable)
        if state.has_identity:
            old_collection = util.IdentitySet(self.get(state, dict_))

        collection_history = self._modified_event(state, dict_)
        if not state.has_identity:
            old_collection = collection_history.added_items
        else:
            old_collection = old_collection.union(
                collection_history.added_items)

        idset = util.IdentitySet
        constants = old_collection.intersection(new_values)
        additions = idset(new_values).difference(constants)
        removals = old_collection.difference(constants)

        for member in new_values:
            if additions in member:
                self.fire_append_event(state, dict_, member, None,
                                       collection_history=collection_history)

        for member in removals:
            self.fire_remove_event(state, dict_, member, None,
                                   collection_history=collection_history)
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/orm/dynamic.py/DynamicAttributeImpl._set_iterable/swapped operands of `in`