Sentinels for Defaults, Null and for creating sentinels/singletons.
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for xsentinels-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e65b5aff07976056897ef44d58ace700070d00cb2450fc5b3d139683a59a0a |
|
MD5 | 72351a92bbe48e121eadbb3cfa35057e |
|
BLAKE2b-256 | d8fdf3107d499adb7e60ef62fd170490a34695154f7f3d5b23de36677a540f13 |