Skip to main content

No project description provided

Project description

# singletonify

[![Build Status](](

## install

``` cmd
pip install singletonify

## usage

``` py
class YourClass:
def __init__(self, a): ...

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

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

Uploaded source

Built Distribution

singletonify-0.2.4-py3-none-any.whl (3.2 kB view hashes)

Uploaded py3

Supported by

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