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
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.0.tar.gz
(15.4 kB
view details)
File details
Details for the file singletons-0.2.0.tar.gz.
File metadata
- Download URL: singletons-0.2.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54ea32d23e767c93ae003262699125428935cbdd0e0fd87435fa61d50dda520b
|
|
| MD5 |
2813d0b93ebd47e7d5a9f292a8c2deca
|
|
| BLAKE2b-256 |
79153af3abbee649f8509c2850b3933426e9c4053c6e7f655e147ecb0dd1a564
|