GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-patterns/borg.py at master · jliuhust/python-patterns Expand file tree/ Copy pathborg.pyMore file actions 24 lines (17 loc) · 497 Bytes / Copy pathborg.pyFile metadata and controls24 lines (17 loc) · 497 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 class Borg: __shared_state = {} def __init__(self): self.__dict__ = self.__shared_state self.state = 'Running' def __str__(self): return self.state if __name__ == '__main__': rm1 = Borg() rm2 = Borg() print('rm1 state: {}'.format(rm1)) print('rm2 state: {}'.format(rm2)) rm2.state = 'Idle' print('rm1 state: {}'.format(rm1)) print('rm2 state: {}'.format(rm2)) print('rm1 id: {}', id(rm1)) print('rm2 id: {}', id(rm2)) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |