Skip to content

Dimitri-WEI-Lingfeng/return_type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

python utility generic type: ReturnType

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages