Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rj_type_hint_checker-0.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rj_type_hint_checker-0.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for rj_type_hint_checker-0.0.0.tar.gz
Algorithm Hash digest
SHA256 41885e45de7bc9cd41e9a0a2e0f6995a3eab6d047e5c7d6e96a88bb9a4324ce8
MD5 207563785b6422c2f595a0e7b98cb6de
BLAKE2b-256 7d044b945fdeafd4b14cc6920f52cacc8c7638286d88d48972fbb2e9bbe3226c

See more details on using hashes here.

File details

Details for the file rj_type_hint_checker-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rj_type_hint_checker-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 265c6ea86ba18ca994b4f09dc73cbf5546c6865c1d374fbbc7bd46b155c9a337
MD5 937d9ffef9da4f7f4c84100c0c7a00df
BLAKE2b-256 9fd5cc59a1e3d6892543af5d5784c383307985b07f4b3e8eeec73ab9e6e13d8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page