Skip to content

wearepal/teext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a650c3a · Dec 18, 2022

History

65 Commits
Oct 7, 2022
Jun 22, 2021
Aug 25, 2020
Dec 5, 2022
Oct 13, 2022
Jun 24, 2020
Jun 24, 2020
Aug 21, 2020
Mar 15, 2022
Aug 25, 2020
Oct 16, 2022
Oct 13, 2022
Dec 18, 2022

Repository files navigation

teext – typing extensions extensions

Package which provides useful types.

Examples

Value-constraint types without runtime overhead

These types are most useful in conjunction with static type checkers like mypy.

import teext as tx

def f(x: tx.PositiveInt) -> None:
    print(x)

a = 5
assert tx.is_positive_int(a)
f(a)  # OK
f(7)  # works at runtime but mypy gives error

assert tx.is_positive_int(-3)  # AssertionError