No project description provided
Project description
install
pip install singletonify
usage
@singleton
class YourClass:
pass
assert YourClass() is YourClass()
why not other
There are many singleton libraries on pypi, but their all has problem:
singleton - cannot use issubclass() or __mro__ or …
singleton-decorator - cannot use isinstance() .
singleton_factory - wtf, why do people use dict()[hash(obj)] = obj ?
singletonmetaclasss - a little like this, but not a decorator.
singleton3 - haha
pysingleton - ABANDONED.
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
singletonify-0.2.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for singletonify-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 133c9a419c44c130d49e7059b6f8e8cc34f49d7e3ae6a54145a6daa50de3c944 |
|
MD5 | 6c80eaf49a84b1c48cd9a6fb372c16a7 |
|
BLAKE2b-256 | 83420c8aadc0608e244128b93ed80a6a4b3f283ddcab7eb581420c94f4977956 |