{"library":"ty","title":"ty: Extremely Fast Python Type Checker","description":"ty is an extremely fast Python type checker and language server, written in Rust. It aims to provide comprehensive diagnostics and real-time editor integration, offering significantly faster performance compared to other Python type checkers. Currently in beta/preview, it is under active and rapid development with frequent releases, typically multiple times a week.","status":"active","version":"0.0.28","language":"en","source_language":"en","source_url":"https://github.com/astral-sh/ty","tags":["type checker","static analysis","rust","performance","linter"],"install":[{"cmd":"pip install ty","lang":"bash","label":"Install with pip"},{"cmd":"uv tool install ty","lang":"bash","label":"Install with uv (recommended for persistent projects)"},{"cmd":"uvx ty check","lang":"bash","label":"Run without explicit install (temporary environment)"}],"dependencies":[{"reason":"Requires Python 3.8 or newer to run.","package":"python","optional":false}],"imports":[{"note":"ty is primarily a command-line interface (CLI) tool for static analysis, not a Python library intended for direct programmatic import and use within application code. Its core is written in Rust.","symbol":"ty","correct":"ty check my_file.py"}],"quickstart":{"code":"import typing\n\ndef greet(name: str) -> str:\n    return \"Hello, \" + name\n\n# Intentional type error for demonstration\nresult: int = greet(\"World\") \n","lang":"python","description":"Save the code above as `main.py`. Then, run `ty check` from your terminal in the same directory. ty will analyze the file and report the type error. Ensure `ty` is installed or run with `uvx`."},"warnings":[{"fix":"Always consult the latest documentation and release notes before upgrading. Adjust configurations and suppression comments (`# ty: ignore`) as needed.","message":"ty is currently in 0.0.x versioning, meaning its API is not yet stable. Breaking changes, including changes to diagnostics and configuration formats, may occur between any two versions. Users should review release notes for each update.","severity":"breaking","affected_versions":"<=0.0.28 (all 0.0.x versions)"},{"fix":"Use with caution in critical environments. Consider using more mature type checkers like MyPy or Pyright for production systems until ty reaches a stable 1.0 release.","message":"As a preview release, ty is not yet recommended for production use. It may have missing features, known issues, or unexpected behavior in certain complex scenarios. It's best suited for experimentation, personal projects, or integrating into development workflows for fast feedback.","severity":"gotcha","affected_versions":"<=0.0.28"},{"fix":"Standardize on one configuration file (`pyproject.toml` under `[tool.ty]` or a standalone `ty.toml`) to avoid unexpected behavior. Be aware of this precedence rule when troubleshooting configuration issues.","message":"When both `ty.toml` and `pyproject.toml` files are present in the same directory, `ty.toml` takes precedence for configuration settings, and the `[tool.ty]` section in `pyproject.toml` will be ignored.","severity":"gotcha","affected_versions":"<=0.0.28"},{"fix":"Ensure you run `ty check` from within an activated virtual environment or use `uv run ty check`. Alternatively, explicitly specify the Python interpreter path using the `--python /path/to/python` flag.","message":"Correct environment discovery is crucial for ty to find installed packages and resolve imports. If ty cannot find an active virtual environment or a `.venv` directory, it may fall back to system Python, leading to `unresolved-import` diagnostics for project dependencies.","severity":"gotcha","affected_versions":"<=0.0.28"},{"fix":"Adopt the more specific `type:ignore[ty:CODE]` syntax where `CODE` refers to the specific diagnostic code (e.g., `ty:invalid-return-type`) for fine-grained suppression. Review existing `# type: ignore` comments and update them for clarity and specificity.","message":"From version `0.0.25`, ty introduced support for `type:ignore[ty:code]` suppressions, aligning with `ruff`'s suppression mechanism. Older, general `# type: ignore` comments might behave differently or be less granular.","severity":"breaking","affected_versions":">=0.0.25"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}