Skip to main content

Sentinels for Defaults, Null and for creating sentinels/singletons.

Project description

PythonSupport PyPI version

Overview

Various objects that allow for sentinel-like singletons for various purposes, including:

  • Ones pre-defined in this library:
    • Default
    • Null
  • Also, Easily create your own custom singletons/sentinels types.

📄 Detailed Documentation | 🐍 PyPi

Install

# via pip
pip install xsentinels

# via poetry
poetry add xsentinels

Quick Start

from xsentinels import Default
import os

def my_func(my_param = Default):
    if my_param is Default:
        # Resolve default value for parameter, otherwise None.
        my_param = os.environ.get('MY_PARAM', None)
    ...

Licensing

This library is licensed under the MIT-0 License. See the LICENSE file.

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

xsentinels-1.3.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

xsentinels-1.3.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file xsentinels-1.3.1.tar.gz.

File metadata

  • Download URL: xsentinels-1.3.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1020-azure

File hashes

Hashes for xsentinels-1.3.1.tar.gz
Algorithm Hash digest
SHA256 65e857643a0237296346c468a6762d242b2f3a970cc93aa0325127aba89a789a
MD5 9058b4d6402a2d55f831c4023b47d7c6
BLAKE2b-256 b3a2420de554d9fd3670561e171415a2bd5fcd97d72d0ca68b9abb0942ded1ae

See more details on using hashes here.

File details

Details for the file xsentinels-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: xsentinels-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-1020-azure

File hashes

Hashes for xsentinels-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3a68cb3e070cdd00c61856f20f3fc9c2df0339f0ad0e621a4ba2a07e023e6a2
MD5 ba89a990fc82452e84c762427eccbdc0
BLAKE2b-256 2da54eaa5dc8d9e7dc575ec8289136e3fd943734a12cc88b93a2ce4dcae6a56e

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