Introduce strict typing in your functions.
Project description
Introspector
[WIP] A Python library to write strongly typed code.
Table of contents
Introduction
Introduce strict typing in your functions.
This project is under development.
Requirements
- Python >= 3.10
Basic usage
import introspector
@introspector.strict
def foo(a: int, b: list[dict[str, Any]]) -> list[int]:
# Some funny code...
return [1, 2, 3, 4]
foo(
42,
[
{
'x': ['hello', 'world'],
'y': 3.14,
},
],
)
When the code is executed, the instrospector.strict
decorator will inspect the signature of the foo
function and compare it with the values passed in its parameters.
If the typing of the values does not match the signature of the function, introspector will throw a TypeError
exception.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
introspector-0.2.0a0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for introspector-0.2.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dffc10960ad3b6d9f949b931b6cde662a01d0ef54a03010abd6c35facf7c04b0 |
|
MD5 | 52632d2f6c8998748d7a059fb0537592 |
|
BLAKE2b-256 | a25e874c9e2c198c93d43ffb40c28a107d9248385e71b960cf8f104aba277417 |