Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. class Singleton(type):
  2. _instances = {}
  3.  
  4. def __call__(cls, *args, **kwargs):
  5. //make name change here
  6. if cls not in cls._instances:
  7. cls._instances[cls] = super(
  8. Singleton,
  9. cls).__call__(
  10. *args,
  11. **kwargs)
  12. return cls._instances[cls]
  13.  
  14. _STAGE = Singleton("_STAGE", (object, ), {})
  15.  
  16. PoolManager(_STAGE):
  17. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement