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
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
969fa20044fcbeb551d615e8b8ecc50cccf3cbe28511916c0e8c720d439947ad
|
|
| MD5 |
2710b6facaa846cf6b21d83e978aaad7
|
|
| BLAKE2b-256 |
b522a69c88649413d63cb5bd8e494ae498c0ad15cb34558e20c63df787c31ed9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7254b73f8228175a31fadcb59f1d2ca30b8d673967b053b7a4135ecf6c59fae9
|
|
| MD5 |
ec2ada357ad29912aa214f9e2424e7f4
|
|
| BLAKE2b-256 |
d1a7de67b1ff6cd821fb48ca60b95efe1db3be157622464e2bde0ac934df5933
|