Returns None if a dict key does not exist
Project description
Python Optional
Returns None
if a dict key does not exist
Install
pip install python_optional
Usage
from python_optional import optional
data = {
'a' : 'b'
}
result = optional(data).get('a') # 'b'
result = optional(data).get('z') # None
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
python_optional-1.0.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for python_optional-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67da420e835535306e52757d8aa7f48e09fed86ee7353cb18aa53db7e6853ec |
|
MD5 | 1d2be7ec87b4de08312e3f57b589b782 |
|
BLAKE2b-256 | c079a17fbf90ef7dec3644d0a34acbc17bff6ed91311b9d7aa2ad0771df5b5bc |