skip to navigation
skip to content

singletonify 0.1.1.0

Latest Version: 0.1.2.0


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.
 
File Type Py Version Uploaded on Size
singletonify-0.1.1.0-py3.6.egg (md5) Python Egg 3.6 2018-01-13 3KB
singletonify-0.1.1.0.tar.gz (md5) Source 2018-01-13 2KB