1# Copyright 2001 Alex Martelli 2# SPDX-License-Identifier: CC-BY-SA-3.0 3''' 4CC BY-SA 3.0 5Creative Commons Attribution-ShareAlike 3.0 Unported 6http://creativecommons.org/licenses/by-sa/3.0/ 7Sourced from: 8http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-borg/ 9''' 10#An alternative to singletons. All instances of a particular subclass of Borg will have the exact same state 11class Borg: 12 _shared_state = {} 13 def __init__(self): 14 self.__dict__ = self._shared_state 15