From 709a59b7c9efb620d3371bf3ee4763babe1ff56e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 18 Mar 2011 21:33:45 -0400 Subject: [PATCH] BORG --- clint/misc.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 clint/misc.py diff --git a/clint/misc.py b/clint/misc.py new file mode 100644 index 0000000..2a7e87e --- /dev/null +++ b/clint/misc.py @@ -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 \ No newline at end of file