{"library":"pytype","title":"Pytype","description":"Pytype is a static type analyzer for Python that infers and checks types in Python code, even without explicit type annotations. It can lint plain Python code for common mistakes, enforce user-provided type annotations, and generate `.pyi` stub files. Developed by Google, Pytype is currently in maintenance mode, with Python 3.12 being the last officially supported version, focusing on bugfixes rather than new features.","language":"python","status":"maintenance","last_verified":"Sun Apr 12","install":{"commands":["pip install pytype"],"cli":{"name":"pytype","version":"2024.10.11"}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# To check a single file or directory:\n# pytype my_module.py\n# pytype my_package/\n\n# For package-wide configuration using pyproject.toml:\n# 1. Create a pyproject.toml in your project root with the following:\n# [tool.pytype]\n# inputs = ['your_package_name']\n\n# 2. Then run pytype without arguments:\n# pytype\n\n# Example Python file (example.py):\ndef greet(name):\n    return \"Hello, \" + name\n\ndef add(a, b):\n    return a + b\n\n# Run pytype on this file from your terminal:\n# pytype example.py\n# Expected output for add function (e.g., if you call add(1, '2')):\n# File \"example.py\", line 5, in add: unsupported operand type(s) for +: 'int' and 'str' [unsupported-operands]","lang":"bash","description":"Pytype is primarily a command-line tool. To quickly get started, run `pytype` followed by the file or directory you wish to analyze. For project-level configuration, use a `pyproject.toml` file to specify inputs and settings.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}