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.2.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

xsentinels-1.2.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xsentinels-1.2.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for xsentinels-1.2.1.tar.gz
Algorithm Hash digest
SHA256 532dec43c517973f1db5fb30c9791628e413bb7314dd9a5de63c9a8e120fbdfc
MD5 ed4b792b8ddac42ae1094d6828237f1f
BLAKE2b-256 6c58030acd4e7ffc5d712fcb3c5698d0a10e0aa8f47e957999f709fbced12047

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xsentinels-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for xsentinels-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec90f90a412bf5f2d5e54867d5f84aec60c305948bd5384c60a752f5696e4a0d
MD5 4c53351391d8f2724d6a129c8af074bc
BLAKE2b-256 f729797596ec766d70ed0e4818efc87bb3b7860e5f41a9b94d1fcf6ee0a5b639

See more details on using hashes here.

Supported by

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