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.1.1.0.tar.gz
(2.1 kB
view hashes)