Guest

Borg Pattern

By: a guest on Jun 12th, 2011  |  syntax: Python  |  size: 0.17 KB  |  hits: 125  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. class Borg:
  2.     __shared_state = {}
  3.     def __init__(self):
  4.         self.__dict__ = self.__shared_state
  5.     # and whatever else you want in your class -- that's all!