Skip to main content

A singleton package that can prevent reference cycle

Project description

my_singleton Package

This is a simple singleton. Borg pattern can achieve this aim by share state, however it can't solve this problem in which 2 objects refer circularly.

e.g. 
obj = object
Class A(obj):
    def __init__(self):
        self.b_obj = B()

Class B(obj):
    def __init__(self):
        self.a_obj = A()

when we define c = A(),
there must be a err.

but,
if obj = my_singleton,
from nocycle_singleton.singleton import Singleton as my_singleton,

we can solve this. 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nocycle_singleton-0.0.3.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

nocycle_singleton-0.0.3-py2-none-any.whl (2.6 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page