Skip to main content

No project description provided

Project description


singletonify
============

install
-------

.. code-block:: cmd

pip install singletonify

usage
-----

.. code-block:: py

@singleton
class YourClass:
pass

assert YourClass() is YourClass()

why not other
-------------

There are many singleton libraries on pypi, but their all has problem:


* `singleton <https://pypi.python.org/pypi/singleton>`_ - cannot use ``issubclass()`` or ``__mro__`` or ...
* `singleton-decorator <https://pypi.python.org/pypi/singleton-decorator>`_ - cannot use ``isinstance()`` .
* `singleton_factory <https://pypi.python.org/pypi/singleton_factory>`_ - wtf, why do people use ``dict()[hash(obj)] = obj`` ?
* `singletonmetaclasss <https://pypi.python.org/pypi/singletonmetaclasss/0.1>`_ - a little like this, but not a decorator.
* `singleton3 <https://pypi.python.org/pypi/singleton3>`_ - haha
* `pysingleton <https://pypi.python.org/pypi/pysingleton>`_ - ABANDONED.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for singletonify, version 0.1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size singletonify-0.1.0.1-py3.6.egg (3.2 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size singletonify-0.1.0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page