Singleton metaclasses and singleton factories
Project description
Declaring singleton classes and singleton factories with different scopes of instantiation, striving for thread-safety and simplicity.
Free software: MIT license
Installation
pip install singletons
Quick Example
import singletons @singletons.GlobalFactory def my_uuid(): return uuid.uuid4() # elsewhere... my_uuid() # will return the global instance of a UUID object
Documentation
Development
To run the all tests run:
tox
Changelog
master
0.2.2 (2018-02-01)
Shows warning rather than giving exception when using greenthread singletons without a greenthread environment
0.2.1 (2018-01-29)
CI changes
0.2.0 (2018-01-23)
More tests
Usage examples added to documentation
Fixed issues revealed by tests
0.1.0 (2018-01-22)
First release on PyPI.
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
singletons-0.2.3.tar.gz
(15.6 kB
view hashes)
Built Distribution
Close
Hashes for singletons-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1fa48be24bb301ae6f4a4be10f4a4535f4618b154aac26bb3b1d1e0996eb6cf |
|
MD5 | be18497b9ba61ded8093b59a06180806 |
|
BLAKE2b-256 | b4305d42c24bf08ffcc931479c638a0eac841b65a480a5c4736959a28fcb2e30 |