Skip to main content

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


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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page