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.
Metadata
Release files for singletons 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| singletons-0.2.2.tar.gz | 16.0 kB | Details |
Release files / singletons-0.2.2.tar.gz
| Download URL | singletons-0.2.2.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
156ab9e99bb132e1ecb2b7c6bc22aa8b21914fcb583cf2da6eac9e3b282501fc
|
|
BLAKE2b-256 checksum How to use checksums |
aa63476f1ea7219f1bb64445b6fff5e44d5f890b0b3a6a34223bf69c92b399be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |