Skip to main content

Singleton types.

Project description

solus

License Version Downloads Discord

Documentation Check Test Coverage

Singleton types.

Installing

Python 3.8 or above is required.

pip

Installing the library with pip is quite simple:

$ pip install solus

Alternatively, the library can be installed from source:

$ git clone https://github.com/nekitdev/solus.git
$ cd solus
$ python -m pip install .

poetry

You can add solus as a dependency with the following command:

$ poetry add solus

Or by directly specifying it in the configuration like so:

[tool.poetry.dependencies]
solus = "^1.2.2"

Alternatively, you can add it directly from the source:

[tool.poetry.dependencies.solus]
git = "https://github.com/nekitdev/solus.git"

Examples

Default

Singleton type is used to create thread-safe singletons.

from solus import Singleton


class Null(Singleton):
    ...

Somewhere else in the code:

null = Null()  # instantiate

Unsafe

UnsafeSingleton type is used to create thread-unsafe singletons.

from solus import UnsafeSingleton


class Null(UnsafeSingleton):
    ...


null = Null()  # instantiate right away

Warning

!!! warning

It is highly recommended to instantiate unsafe singleton types right after their creation!

Documentation

You can find the documentation here.

Support

If you need support with the library, you can send an email or refer to the official Discord server.

Changelog

You can find the changelog here.

Security Policy

You can find the Security Policy of solus here.

Contributing

If you are interested in contributing to solus, make sure to take a look at the Contributing Guide, as well as the Code of Conduct.

License

solus is licensed under the MIT License terms. See License for details.

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

solus-1.2.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solus-1.2.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file solus-1.2.2.tar.gz.

File metadata

  • Download URL: solus-1.2.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for solus-1.2.2.tar.gz
Algorithm Hash digest
SHA256 4bf499b0ea8fd9aca23d27d559008dfee1c75b9336f5a9c7143069c3f5282444
MD5 f1f7573af40670d37bbbbc79e80fe519
BLAKE2b-256 1b3930f3e81fa40f51ccf55a187928e8783e4860f9002d4e48abcfcccabe9d10

See more details on using hashes here.

File details

Details for the file solus-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: solus-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for solus-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2587bcc74cd872a21532cf5cdc9617796473626c3fd7033fcbb09e0f1bf528bc
MD5 d468f4401b5a9f83bf520d89438c41da
BLAKE2b-256 bf14e63493752b7e408f775e10cea9551a61190aaa99b63483b57dc769af9602

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page