borg.py

talk-0.001/talklib/borg.py · 307 B

From the archive talk-0.001.tar.gz

Download the archive   « Back to the archive contents

"""This is the Borg design pattern class, from
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531>.
Classes inherit this property if they want to share their state
between all instances."""

class Borg:
    __shared_state = {}
    def __init__(self):
        self.__dict__ = self.__shared_state

Site Stats

Snippets: 1791
Codebases: 571