Empty the collection, firing a mutation event for each entity.
(
self, initiator: Optional[AttributeEventToken] = None
)
| 554 | self._data()._sa_remover(item, _sa_initiator=False) |
| 555 | |
| 556 | def clear_with_event( |
| 557 | self, initiator: Optional[AttributeEventToken] = None |
| 558 | ) -> None: |
| 559 | """Empty the collection, firing a mutation event for each entity.""" |
| 560 | |
| 561 | if self.empty: |
| 562 | self._refuse_empty() |
| 563 | remover = self._data()._sa_remover |
| 564 | for item in list(self): |
| 565 | remover(item, _sa_initiator=initiator) |
| 566 | |
| 567 | def clear_without_event(self) -> None: |
| 568 | """Empty the collection, firing no events.""" |