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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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