Skip to main content

No project description provided

Project description

# singletonify

[![Build Status](https://travis-ci.com/Cologler/singletonify-python.svg?branch=master)](https://travis-ci.com/Cologler/singletonify-python)
[![PyPI](https://img.shields.io/pypi/v/singletonify.svg)](https://pypi.org/project/singletonify/)


## install

``` cmd
pip install singletonify
```

## usage

``` py
@singleton(a=3)
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](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.2.4
Filename, size File type Python version Upload date Hashes
Filename, size singletonify-0.2.4-py3-none-any.whl (3.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size singletonify-0.2.4.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page