This release is a pre-release and may not be stable for production use.
This library provides run-time type checking for functions defined with PEP 484 argument (and return) type annotations, and any arbitrary objects. It can be used together with static type checkers as an additional layer of type safety, to catch type violations that could only be detected at run time.
Two principal ways to do type checking are provided:
The check_type function:
like isinstance(), but supports arbitrary type annotations (within limits)
can be used as a cast() replacement, but with actual checking of the value
Code instrumentation:
entire modules, or individual functions (via @typechecked) are recompiled, with type checking code injected into them
automatically checks function arguments, return values and assignments to annotated local variables
for generator functions (regular and async), checks yield and send values
requires the original source code of the instrumented module(s) to be accessible
Two options are provided for code instrumentation:
the @typechecked function:
can be applied to functions individually
the import hook (typeguard.install_import_hook()):
automatically instruments targeted modules on import
no manual code changes required in the target modules
requires the import hook to be installed before the targeted modules are imported
may clash with other import hooks
See the documentation for further information.
Metadata
Release files for typeguard 4.0.0rc5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| typeguard-4.0.0rc5.tar.gz | 65.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typeguard-4.0.0rc5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.0 kB
Release files / typeguard-4.0.0rc5.tar.gz
| Download URL | typeguard-4.0.0rc5.tar.gz |
|---|---|
| Size | 65.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f3f112c1744dc35022a9a90770683e6138c441c2e2f8d32f01f6f71a2b4f15f
|
|
BLAKE2b-256 checksum How to use checksums |
9f85de8d213bdb834745f50558f9d9873d2e5445760380f53ef1c408911e20f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Release files / typeguard-4.0.0rc5-py3-none-any.whl
| Download URL | typeguard-4.0.0rc5-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a253ea36b5d908465bd0cf40832b7dce4335844788737c63ad3deb891b15452
|
|
BLAKE2b-256 checksum How to use checksums |
ce36f1e441b35f699b970efb700d1dbc1ddd1aec311c83b7eb60caf5c92ec9f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.3
|
Security for typeguard 4.0.0rc5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.