Skip to main content

Typing extensions extensions

Project description

teext – typing extensions extensions

Package which provides useful types.

Documentation

Examples

Constraint types without runtime overhead

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

import teext as tx

a = tx.PositiveInt(5)  # OK

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

f(a)  # OK
f(7)  # works at runtime but mypy gives error

b = tx.PositiveInt(-3)  # AssertionError

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

teext-0.1.3.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

teext-0.1.3-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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