This commit is contained in:
Kenneth Reitz
2011-03-18 21:33:45 -04:00
parent 669bf76097
commit 709a59b7c9
+9
View File
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
class Borg(object):
"""All instances of Borg have the same value."""
_shared_state = {}
def __new__(cls, *a, **k):
obj = object.__new__(cls, *a, **k)
obj.__dict__ = cls._shared_state
return obj