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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nocycle_singleton-0.0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d86f142fb348c119721587b8e17b2c1cdb0e8716f3948100ad1a2d69bf6169 |
|
MD5 | 5b9534340aaa83644788a90355710f69 |
|
BLAKE2b-256 | bdc0ee1c9a35130f3cb9c8dcebbe9e79ba327aa6c505054882ccbce725e14574 |