Skip to main content

typed undefined

Project description

Typed Undefined

When None is not valid default value you can always use undefined.

from undefined import Undefined, undefined, resolve


def foo(bar: Undefined[int] = undefined) -> int:
    return resolve(undefined, 10)


foo(1)  # ok
foo(1.0)  # error

a: Undefined[int] = 1  # ok
b: Undefined[int] = 0.5  # error

mypy integration

You should add undefined_mypy to list of mypy plugins:

[mypy]
plugins = undefined.mypy

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

typed-undefined-0.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

typed_undefined-0.1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page