Generic type ReturnType and mypy checker plugin
Project description
ReturnType
Generic type ReturnType and mypy checker plugin
Install
pip install return_type
add plugin to mypy.ini
[mypy]
plugins = return_type.mypy-plugin.py
Usage
import typing as t
from return_type import ReturnType
C = t.Callable[..., int]
RC = ReturnType[C]
assert RC = int
v1: RC = 1 # correct
v2: RC = 1. # error
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
return_type-0.1.1.tar.gz
(2.2 kB
view hashes)