title: Can someone explain me the Borg design pattern in python?
body: <p>I know this pattern is used in order to create multiple instances with the same state, but i really don't understand how it works.</p>
  
  <pre><code>class Borg:
      _shared_state = {}
  
      def __init__(self):
      self.__dict__ = self._shared_state
  
  
  
  class Singleton(Borg):
  
      def __init__(self, **kwargs):
          Borg.__init__(self)
          self._shared_state.update(kwargs)
  
      def __str__(self):
          return str(self._shared_state)
  </code></pre>
  
  <p>More specifically, what happens when in the Singleton <strong>init</strong> method I call Borg.<strong>init</strong> ? </p>