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

Class Data

recipes/Python/131499_Observer_Pattern/recipe-131499.py:22–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21# Example usage
22class Data(Subject):
23 def __init__(self, name=''):
24 Subject.__init__(self)
25 self.name = name
26 self.data = 0
27
28 def setData(self, data):
29 self.data = data
30 self.notify()
31
32 def getData(self):
33 return self.data
34
35
36class HexViewer:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected