Skip to main content

Patrón 'Singleton' en Python 3.

Project description

Solterón

Descripción

Solteron es un módulo de Python que incluye una meta-clase, del mismo nombre, que puede ser heredada para garantizar una correcta implementación del patrón 'Singleton' en tipos definidos por el usuario. Esto se logra interfiriendo con el curso de construcción de las instancias de clases marcadas con metaclass=Solteron, devolviendo la instancia ya creada o instanciando una nueva sólo en caso que no exista.

Instalación

Puede decargar e instalar solteron utilizando el manejador de paquetes PIP, según se indica a continuación:

Ejecute el siguiente comando en la terminal:

pip install solteron

Uso Básico

Puede emplear tanto Solteron como Singleton en la definición de la clase para garantizar que el patró se aplique.

from solteron import Solteron, Singleton

class MiSingleton(metaclass = Solteron):
    ...

class MiOtroSingleton(metaclass = Singleton)

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

solteron-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

solteron-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file solteron-0.1.1.tar.gz.

File metadata

  • Download URL: solteron-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for solteron-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6b0883b957e4ef700f70c772cf7e3504d258459fc5f28eda7976fc2ee6b8500e
MD5 2b0807c03c7d9b4eb0f1796faa454681
BLAKE2b-256 61537f95b6519cd3657b927b391768779c6eb40bede8663157f1abd79071ccc3

See more details on using hashes here.

File details

Details for the file solteron-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: solteron-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for solteron-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ddc447064b3219ea5da29da4d3821c6a5be434089d7a07c7d08968e3b45fc22
MD5 9e99c5ebefea4d2e9224222ffe552313
BLAKE2b-256 7fd55fa1bd6a832dc815a60c8f8262e59f3ad8a59cc2c44e3bd72d1e280922c8

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