Skip to main content

typed_singleton

A simple Python decorator library for creating singletons.

Installation

pip install typed_singleton

Usage

from typed_singleton import Singleton


@Singleton
class SingletonClass:
    def __init__(self, my_value: int) -> None:
        self.my_value = my_value

    def get_my_awesome_value(self) -> int:
        return self.my_value

instance_1 = SingletonClass(1)
instance_2 = SingletonClass(2)
print(instance_1 is instance_2)  # True

print(instance_1.get_my_awesome_value())  # 1
print(instance_2.get_my_awesome_value())  # also 1

Metadata

Release files for typed_singleton 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typed_singleton 0.1.2
File Size Uploaded Provenance Actions
typed_singleton-0.1.2.tar.gz 2.1 kB Without provenance Details for typed_singleton-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for typed_singleton 0.1.2
File Interpreter ABI Platform Actions
typed_singleton-0.1.2-py3-none-any.whl Python 3 none any Details for typed_singleton-0.1.2-py3-none-any.whl

Total release size: 5.2 kB

Release files / typed_singleton-0.1.2.tar.gz

Download URL typed_singleton-0.1.2.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ea0f53f718a5be5d8a3de97da4f0536521edb5e37af3d60f5b5c12e575a184c6
BLAKE2b-256 checksum
How to use checksums
adff20b1da69da24317b67b9e90c064aaf3a0c47ac942d98db0a5e90ab458f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

Release files / typed_singleton-0.1.2-py3-none-any.whl

Download URL typed_singleton-0.1.2-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ac8c64f8cadcd5e091e6f9c0d2ec6468c5dee31cb868af95d0dd4f49a6a9e5f
BLAKE2b-256 checksum
How to use checksums
7daa4582791c4b4c25bff0555810d38acb1e6e298c714d7eb73d8fbc39695f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

Security for typed_singleton 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page