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 hashes)
Built Distribution
Close
Hashes for typed_undefined-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee3963b669902b7c7d296bd07414bbe10bc265a7a56d94b7e685551b969eebe |
|
MD5 | c0780331137c865265a7640fe425ad14 |
|
BLAKE2b-256 | 0fb44c8f4e5ff6ab28dca1304b568ec1614b93637025a874a60687cb429701fb |