Skip to main content

Defines NotGiven and NOT_GIVEN

Project description

NotGiven and NOT_GIVEN for Python

pip install notgiven

Sentinel singleton to distinguish between omitted arguments and those explicitly set to None.

  • NOT_GIVEN is the only instance of NotGiven.
  • NotGiven cannot be instantiated or subclassed.
  • NOT_GIVEN is falsy (bool(NOT_GIVEN) is always False)
  • Pickling/unpickling, copying, and deepcopying NOT_GIVEN all result in the same value.
  • NOT_GIVEN has no slots, so attributes may not be set on it.
  • NOT_GIVEN's string representation is "NOT_GIVEN"
  • Thread-safe in all situations.
from notgiven import (
    NotGiven,
    NOT_GIVEN,
    is_given,
    is_not_given,
    is_given_guard,  # Only useful in 3.13+
    is_not_given_guard,  # Only useful in 3.13+
)

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

notgiven-0.0.5.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

notgiven-0.0.5-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file notgiven-0.0.5.tar.gz.

File metadata

  • Download URL: notgiven-0.0.5.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for notgiven-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1206e5c2357a87ddde05a006adde5bb3d3bc09d11d906bcd21fa3327cc6f3774
MD5 63825e626edd2e603ac2511f4c159411
BLAKE2b-256 c87ba0427b6721aee7e936c4f5d2472382887fce8f520a313251f3e306109405

See more details on using hashes here.

File details

Details for the file notgiven-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: notgiven-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for notgiven-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0fd55e25281966d175319e989d4e60dc3a31040be30ff9ca101e488bee410d
MD5 dce075278f5bc7633eb081c12a60557d
BLAKE2b-256 723e13fc35dc8c8a6e17eb8ba888aa9423447d06f9c106d222b4fd0713ffe5c8

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