Skip to main content

List typehints found in Python source code

Project description

typelint

typelint is a program that detects and reports typehints in Python source code.

List type hints:

python -m typelint mypython.py

Quiet mode (number is reported as $?):

python -m typelint --quiet mypython.py

In either mode the number of typehints found is reported as the program's exit status. Counts above 99 are reported as 99 (so as to avoid overflowing the exit status value, and to leave some room for reporting errors).

Exit status

Because the count is reported at the exit status and the shell's convention is to treat 0 as true (success), it is convenient to use typelint as a test in shell scripts:

if python typelint.py mypython.py
then
    echo "no typehints found"
else
    echo "typehints found"
fi

END

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

typelint-0.0.1.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

typelint-0.0.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

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