Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app_name = 'Teste'
- app_path = '/home/mauro'
- class Common(object):
- def __init__(self, path=None):
- self.app_path = path and path or app_path
- @property
- def _path_(self):
- return self.app_path
- @staticmethod
- def reset_path():
- common.app_path = app_path
- class Nova(object):
- def path(self):
- print common._path_
- if __name__ == '__main__':
- common = Common(path='/home/jorge')
- nova = Nova()
- nova.path()
- print app_path
- a = raw_input('Resetando a _path_ da common')
- Common.reset_path()
- print common._path_
- nova.path()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement