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
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
typed-undefined-0.1.0.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file typed-undefined-0.1.0.tar.gz
.
File metadata
- Download URL: typed-undefined-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afb3206f7818addfed3c139ee981675b8fd4cc4dc14c058b9bb2c26027758c19 |
|
MD5 | 549c19852879cbc469cacb700390ade4 |
|
BLAKE2b-256 | 88517358220e4291ed39466dfcc2145e2be20ebbbd6a611978a706a4e7f0df3f |
File details
Details for the file typed_undefined-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: typed_undefined-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee3963b669902b7c7d296bd07414bbe10bc265a7a56d94b7e685551b969eebe |
|
MD5 | c0780331137c865265a7640fe425ad14 |
|
BLAKE2b-256 | 0fb44c8f4e5ff6ab28dca1304b568ec1614b93637025a874a60687cb429701fb |