Skip to main content

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

Metadata

Release files for typed-undefined 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typed-undefined 0.1.0
File Size Uploaded Provenance
typed-undefined-0.1.0.tar.gz 3.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for typed-undefined 0.1.0
File Interpreter ABI Platform
typed_undefined-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / typed-undefined-0.1.0.tar.gz

Download URL typed-undefined-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
afb3206f7818addfed3c139ee981675b8fd4cc4dc14c058b9bb2c26027758c19
BLAKE2b-256 checksum
How to use checksums
88517358220e4291ed39466dfcc2145e2be20ebbbd6a611978a706a4e7f0df3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0

Release files / typed_undefined-0.1.0-py3-none-any.whl

Download URL typed_undefined-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eee3963b669902b7c7d296bd07414bbe10bc265a7a56d94b7e685551b969eebe
BLAKE2b-256 checksum
How to use checksums
0fb44c8f4e5ff6ab28dca1304b568ec1614b93637025a874a60687cb429701fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0

Security for typed-undefined 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page