MCPcopy Create free account
hub / github.com/ActiveState/code / detach

Method detach

recipes/Python/131499_Observer_Pattern/recipe-131499.py:9–13  ·  view source on GitHub ↗
(self, observer)

Source from the content-addressed store, hash-verified

7 self._observers.append(observer)
8
9 def detach(self, observer):
10 try:
11 self._observers.remove(observer)
12 except ValueError:
13 pass
14
15 def notify(self, modifier=None):
16 for observer in self._observers:

Callers 1

mainFunction · 0.45

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected