Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import __builtin__
- >>> __builtin__.rubbish= 3
- >>> rubbish
- 3
- from mypackage.constants import *
- class Config:
- """
- Borg singlton config object
- """
- __we_are_one = {}
- __myvalue = ""
- def __init__(self):
- #implement the borg patter (we are one)
- self.__dict__ = self.__we_are_one
- def myvalue(self, value=None):
- if value:
- self.__myvalue = value
- return self.__myvalue
- conf = Config()
- conf.myvalue("Hello")
- conf2 = Config()
- print conf2.myvalue()
- import superglobal
- superglobal.whatever = loacalWhatever
- other = superglobal.other
Add Comment
Please, Sign In to add comment