Skip to main content

Simply calls pytypes.enable_global_typechecked_profiler() when 'PYTYPES' env var is set.

Project description

pytypes-env

If PYTYPES env var is set when you import this module then pytypes.enable_global_typechecked_profiler() will be called to enable typechecking. Typechecking will be applied to any import or definition after the import statement.

Usage: Import pytypes_env in a script:

import pytypes_env

def test(foo: str) -> bool:
  return "hello"


test(1)

Then run:

 > python3 test.py
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    test(1)
  File "test.py", line 3, in test
    def test(foo: str) -> bool:
pytypes.exceptions.InputTypeError:
  __main__.test
  called with incompatible types:
Expected: Tuple[str]
Received: Tuple[int]

Project details


Download files

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

Files for pytypes-env, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size pytypes_env-0.0.5-py3-none-any.whl (1.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytypes-env-0.0.5.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page