explaingit

microsoft/pyright

Analysis updated 2026-06-24

15,426PythonAudience · developerComplexity · 3/5Setup · easy

TLDR

Microsoft's fast static type checker for Python. Reads code before it runs and warns about type errors, with a CLI and VS Code extension.

Mindmap

mindmap
  root((pyright))
    Inputs
      Python source
      Type annotations
      Config file
    Outputs
      Type errors
      Warnings
      Diagnostics
    Use Cases
      Catch bugs pre-runtime
      Editor type hints
      CI type checking
    Tech Stack
      TypeScript
      Python
      Node
      VS Code
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add type checking to a large Python codebase to catch bugs before runtime

USE CASE 2

Get inline type errors and autocomplete in VS Code via the Pyright extension

USE CASE 3

Run pyright in CI to enforce type correctness on every pull request

What is it built with?

TypeScriptPythonNodeVS Code

How does it compare?

microsoft/pyrightfabric/fabricansible/awx
Stars15,42615,43015,412
LanguagePythonPythonPython
Setup difficultyeasyeasyhard
Complexity3/53/55/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Install via npm or use the VS Code extension, works best with proper type annotations in your code.

In plain English

Pyright is a static type checker for Python, built by Microsoft. A static type checker reads your code before it runs and warns you about type errors, for instance, if you pass a number to a function that expects a string, or if you try to call a method that doesn't exist on a value. This helps catch bugs early without having to actually run the program. Pyright is designed for high performance and is suitable for large Python codebases. It follows Python's standards for type annotations, the hints you can add to your code to describe what types variables and function arguments should be. It comes in two forms: a command-line tool you can run in a terminal, and an extension for Visual Studio Code, Microsoft's popular code editor. There is also a Pyright Playground at pyright-play.net where you can try it directly in a browser without installing anything. Configuration, installation, and usage details are covered in the documentation at microsoft.github.io/pyright. For temporary file handling in remote environments, you can set the PYRIGHT_TMPDIR environment variable to specify where Pyright stores its temporary files. Questions and community discussion happen in the GitHub Discussions section, and bugs or feature requests can be filed in the Pyright or Pylance issue trackers. The project is open to contributions and follows the Microsoft Open Source Code of Conduct.

Copy-paste prompts

Prompt 1
Set up pyright in a Python project with a pyproject.toml-based config and strict mode
Prompt 2
Configure pyright to run in GitHub Actions and fail the build on type errors
Prompt 3
Show me how to add type annotations to this Python function so pyright stops complaining
Prompt 4
Compare pyright and mypy for a 50k-line Django codebase and recommend one
Prompt 5
Use the PYRIGHT_TMPDIR variable to run pyright in a read-only Docker environment

Frequently asked questions

What is pyright?

Microsoft's fast static type checker for Python. Reads code before it runs and warns about type errors, with a CLI and VS Code extension.

What language is pyright written in?

Mainly Python. The stack also includes TypeScript, Python, Node.

How hard is pyright to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pyright for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub microsoft on gitmyhub

Verify against the repo before relying on details.