Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

type-check

A runtime type-checking decorator for Python functions.

Install

git clone https://github.com/GijsPeletier/type-check.git
cd type-check
pip install -e .

Usage

from type_check import type_check

@type_check
def add(a: int, b: int) -> int:
    return a + b

add(1, 2)       # -> 3
add(1, "2")     # TypeError: argument 'b' is not the right type
                #            (is 'str', should be 'int')

Works with union types, Generic type hints, *args, **kwargs, and string annotations.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages