Posted By

fnl on 08/13/11


Tagged


Versions (?)

Borg class


 / Published in: Python
 

  1. class Borg(object):
  2. # Borg Class Example - do not inherit, just for copy/paste!
  3. # It is faster than the Singleton
  4. # approach if speed is a _big_ issue.
  5.  
  6. __shared_state = {}
  7.  
  8. def __init__(self):
  9. """ Constructor.
  10. """
  11. self.__dict__ = Borg.__shared_state

Report this snippet  

You need to login to post a comment.