Like a None
Project description
Nil Type
Null value for cases when None is part of a data model
from niltype import Nil
if x is Nil: # True only if x is Nil
pass
Example
from niltype import Nil
def get(dictionary, key, default=Nil):
try:
return dictionary[key]
except KeyError:
if default is not Nil:
return default
raise
get({}, 'key') # raises KeyError
get({}, 'key', None) # returns None
Installation
pip3 install niltype
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
niltype-0.3.3.tar.gz
(3.2 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 niltype-0.3.3.tar.gz.
File metadata
- Download URL: niltype-0.3.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2518a8971e225e510e1696c373b38bbdb43281a548b33b728452464f6b296179
|
|
| MD5 |
350576a5bddd6b21d00daabb94544cd6
|
|
| BLAKE2b-256 |
2777bd56d408dcc3198ef241d6a4a29dccab51c51562c133c29c47dcc9e50358
|
File details
Details for the file niltype-0.3.3-py3-none-any.whl.
File metadata
- Download URL: niltype-0.3.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b83a3202fd461c0565fe66541cf45dc5e15ccca2b934ddf40c2f80ac00ac17fc
|
|
| MD5 |
813c149c2798d8c43b246c03bb09d961
|
|
| BLAKE2b-256 |
b0441cda65e0ec76aecab7d65ec1d1ae3e482ab4ef2c12b45e9db535778a02a4
|