mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 00:10:03 +02:00
removes attribute key from observers dict if list of observers is empty
This commit is contained in:
parent
f783d0b25c
commit
ba9dbc03f1
@ -32,6 +32,10 @@ class ObservableObject(ABC):
|
||||
if attribute in self._observers:
|
||||
self._observers[attribute].remove(observer)
|
||||
|
||||
# remove attribute key from observers dict if list of observers is empty
|
||||
if not self._observers[attribute]:
|
||||
del self._observers[attribute]
|
||||
|
||||
@abstractmethod
|
||||
def _remove_observer_if_observable(self, name: str) -> None:
|
||||
"""Removes the current object as an observer from an observable attribute.
|
||||
|
Loading…
x
Reference in New Issue
Block a user