Skip to main content

Force static type hints at import time

This runs mypy on all imports, and currently just dumps the text, but that shows the concept.

Properly hooking both path and file imports might requir something more, and raising proper import errors when files don't pass is also left to do.

However, conceptually it sort of works, and simply importing it in a software can toggle the flag on to force strict typing more.

To use it, add "import typeforce.enforcing" to the modules of the initial code, and watch your code explode when you have a badly typed module.

Also note, that imports will not just be slow, they will be very slow.

asciicast

Metadata

Release files for enforce-typehints 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enforce-typehints 0.0.2
File Size Uploaded
enforce_typehints-0.0.2.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enforce-typehints 0.0.2
File Interpreter ABI Platform
enforce_typehints-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / enforce_typehints-0.0.2.tar.gz

Download URL enforce_typehints-0.0.2.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0de31fe3e4793c3256dcb496e852b2a9db991b8b81110b1598badcfb70a0f60e
BLAKE2b-256 checksum
How to use checksums
282fde23ec289e4d71b45719099be44aa9d7b49e2076b22256b920073cb49d38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release files / enforce_typehints-0.0.2-py3-none-any.whl

Download URL enforce_typehints-0.0.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf369b19e6a9cd0acf0669d25a713af6007ea2b3ea2b3108ede5172a7480ad7e
BLAKE2b-256 checksum
How to use checksums
2a695dd65c84e44b577fa2e1d978dbfbd7ab446949453da96f2e585bbef4653d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page