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.0.tar.gz (5.6 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.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xsentinels-1.3.0.tar.gz
  • Upload date:
  • Size: 5.6 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.0.tar.gz
Algorithm Hash digest
SHA256 969fa20044fcbeb551d615e8b8ecc50cccf3cbe28511916c0e8c720d439947ad
MD5 2710b6facaa846cf6b21d83e978aaad7
BLAKE2b-256 b522a69c88649413d63cb5bd8e494ae498c0ad15cb34558e20c63df787c31ed9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xsentinels-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7254b73f8228175a31fadcb59f1d2ca30b8d673967b053b7a4135ecf6c59fae9
MD5 ec2ada357ad29912aa214f9e2424e7f4
BLAKE2b-256 d1a7de67b1ff6cd821fb48ca60b95efe1db3be157622464e2bde0ac934df5933

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