a rough equivilent of isinstance that works with type hints
Project description
Type Hint Checker
a replacement for isinstance that works with type hints
exports are_type_compatible which can be used as a drop in replacement for isinstance
but works with type hints
are_type_compatible([0, 1, 2], list[int]) # true
are_type_compatible([0, 1, "2"], list[int]) # false
also takes two optional arguments the context which would be the function or class the type hint came from and the namespace which is the namespace to search for types
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rj_type_hint_checker-0.0.0.tar.gz.
File metadata
- Download URL: rj_type_hint_checker-0.0.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41885e45de7bc9cd41e9a0a2e0f6995a3eab6d047e5c7d6e96a88bb9a4324ce8
|
|
| MD5 |
207563785b6422c2f595a0e7b98cb6de
|
|
| BLAKE2b-256 |
7d044b945fdeafd4b14cc6920f52cacc8c7638286d88d48972fbb2e9bbe3226c
|
File details
Details for the file rj_type_hint_checker-0.0.0-py3-none-any.whl.
File metadata
- Download URL: rj_type_hint_checker-0.0.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
265c6ea86ba18ca994b4f09dc73cbf5546c6865c1d374fbbc7bd46b155c9a337
|
|
| MD5 |
937d9ffef9da4f7f4c84100c0c7a00df
|
|
| BLAKE2b-256 |
9fd5cc59a1e3d6892543af5d5784c383307985b07f4b3e8eeec73ab9e6e13d8a
|