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

Uploaded Source

Built Distribution

xsentinels-1.2.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xsentinels-1.2.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.15.0-1035-azure

File hashes

Hashes for xsentinels-1.2.2.tar.gz
Algorithm Hash digest
SHA256 d40517c690e11902b5ffee12062e6ccabebc2cd99e66e3ab5dd61cc9e25a2788
MD5 c9fb6a3f39d9755cfc34235d5ca16105
BLAKE2b-256 630f490ee44f66935e6f450687aca8bea90ae2d34ecdd86311bc60baae35ce12

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xsentinels-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 21e65b5aff07976056897ef44d58ace700070d00cb2450fc5b3d139683a59a0a
MD5 72351a92bbe48e121eadbb3cfa35057e
BLAKE2b-256 d8fdf3107d499adb7e60ef62fd170490a34695154f7f3d5b23de36677a540f13

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