Пример #1
0
 def difference_update(self, *args) -> None:
     """ Remove all elements of another ObservableSet from this ObservableSet. Publishes change notifications """
     with self.lock:
         self.check_disposed()
         self._set.difference_update(*args)
         self._onCollectionChanges(CollectionChange.Extend(
             self, self))  # Need better name...
Пример #2
0
 def symmetric_difference_update(self, *args) -> None:
     """ Update an ObservableSet with the symmetric difference of itself and another.
     Publishes change notification """
     with self.lock:
         self.check_disposed()
         self._set.symmetric_difference_update(*args)
         self._onCollectionChanges(CollectionChange.Extend(self, self))
Пример #3
0
 def update(self, other=None):
     """ update the dictionary with (key, value) pairs from other Observable dictionary / dictionary, overwriting
      existing keys and publish Extend event """
     with self.lock:
         self.check_disposed()
         if other is not None:
             self._dict.update(other)
             self._onCollectionChanges(CollectionChange.Extend(self, other))
Пример #4
0
 def intersection_update(self, *args) -> None:
     """ Update an ObservableSet with the intersection of itself and another. Publishes change notifications """
     with self.lock:
         self.check_disposed()
         self._set.intersection_update(*args)
         self._onCollectionChanges(CollectionChange.Extend(self, self))
Пример #5
0
 def update(self, items: Iterable) -> None:
     """ Update an ObservableSet with the union of itself and others. Publishes change notification """
     with self.lock:
         self.check_disposed()
         self._set.update(items)
         self._onCollectionChanges(CollectionChange.Extend(self, items))
 def extend(self, items: Iterable) -> None:
     """ extend the list by appending elements from the iterable and publishes the change notification """
     with self.lock:
         self.check_disposed()
         self._list.extend(items)
         self._onCollectionChanges(CollectionChange.Extend(self, items))