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

Class DataHolder

recipes/Python/66061_Assign_and_test/recipe-66061.py:9–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7# No problem, again! One tiny, simple utility class makes it easy...:
8
9class DataHolder:
10 def __init__(self, value=None): self.value = value
11 def set(self, value): self.value = value; return value
12 def get(self): return self.value
13# optional but handy, if you use this a lot, either or both of:
14setattr(__builtins__,'DataHolder',DataHolder)
15setattr(__builtins__,'data',DataHolder())

Callers 1

recipe-66061.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected