Skip to main content

Like a None

Project description

Nil Type

Codecov PyPI PyPI - Downloads Python Version

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


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.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

niltype-0.3.4-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file niltype-0.3.4.tar.gz.

File metadata

  • Download URL: niltype-0.3.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for niltype-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c5911f00859c0d4d9fd67654ce00cb85bf0171d6ea61244e2046d14a6ad6e0d7
MD5 bbd65ab149ec112411dbbbc79e2942b0
BLAKE2b-256 d1b339fa00596d54a48effbdfcb552fac1d3ee9aa100320fa9f32abc3663a1b1

See more details on using hashes here.

File details

Details for the file niltype-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: niltype-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for niltype-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 808f5f707f2970d083236a9ed84283e84d61096ccd8c7419d097c44e106d3058
MD5 f5d38eb3cb1e0aaaa3124047c077558a
BLAKE2b-256 70c35c019ddbfc537b5b33e4fc63e1d14190188b446cb73ef89d1a9399e2514d

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