# pyrefly | Meta | Knowledge Base | Instagit

A fast type checker and language server for Python

GitHub Stars: 6.4k

Repository: https://github.com/facebook/pyrefly

---

## Articles

### [How Pyrefly's Type Solving Differs from Other Python Type Checkers](/facebook/pyrefly/difference-pyrefly-type-solving-other-type-checkers)

Discover how Pyrefly's unique type solving engine, built in Rust, provides faster and more consistent Python type checking than other tools. See its groundbreaking performance.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles Attribute Access and Property Types](/facebook/pyrefly/how-pyrefly-handle-attribute-access-property-types)

Learn how Pyrefly handles attribute access and property types using its three phase pipeline: MRO resolution, getattr fallback, and descriptor protocol semantics for accurate type checking.

- Tags: internals
- Published: 2026-05-21

### [How to Use pyrefly init to Migrate from Mypy or Pyright Configuration](/facebook/pyrefly/how-to-use-pyrefly-init-migrate-mypy-pyright-configuration)

Easily migrate Mypy or Pyright configurations to Pyrefly using the pyrefly init command. Automatically convert include paths and settings to pyrefly.toml or pyproject.toml.

- Tags: how-to-guide
- Published: 2026-05-21

### [How to Use pyrefly suppress to Migrate Existing Errors When Upgrading](/facebook/pyrefly/how-to-use-pyrefly-suppress-migrate-errors-upgrading)

Learn how to use pyrefly suppress to migrate existing errors during Pyrefly upgrades. Freeze diagnostics, upgrade seamlessly, and clean up code with this powerful tool.

- Tags: how-to-guide
- Published: 2026-05-21

### [How to Use pyrefly infer to Generate Python Type Annotations](/facebook/pyrefly/how-to-use-pyrefly-infer-generate-type-annotations)

Learn how to use pyrefly infer to automatically add type annotations to your Python code. This powerful tool analyzes your code and inserts type hints directly into your source files.

- Tags: how-to-guide
- Published: 2026-05-21

### [How Pyrefly Handles Type Aliases and Recursive Resolution](/facebook/pyrefly/how-pyrefly-handle-type-aliases-recursive-resolution)

Learn how Pyrefly handles type aliases and recursive resolution with its two-phase architecture. Discover how it separates binding from solving for efficient type checking.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Implements Callable Overload Resolution](/facebook/pyrefly/how-pyrefly-handle-callable-overload-resolution)

Learn how Pyrefly implements callable overload resolution by storing signatures and matching them to PEP 484 rules to prevent type errors.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Handles Import Resolution and Module Finding](/facebook/pyrefly/how-pyrefly-handle-import-resolution-module-finding)

Discover how Pyrefly handles import resolution and module finding with its hierarchical search algorithm. Learn about directory caching, stub package handling, and legacy namespace support.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly's Binding System Represents Definitions, Uses, and Phi Functions](/facebook/pyrefly/how-pyrefly-binding-system-represent-definitions-uses-phi-functions)

Discover how Pyrefly's binding system represents definitions uses and phi functions using Key and Binding payloads for precise code analysis and type solving.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Handles Variance Inference for Generic Classes: A Deep Dive into the Algorithm](/facebook/pyrefly/how-pyrefly-handle-variance-inference-generic-classes)

Pyrefly expertly handles variance inference for generic classes with a 3-phase constraint solver. Learn how it analyzes hierarchies, methods, and fields to determine type variable variance.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Performs Type Inference for Empty Containers: Placeholder Variables and Lazy Unification](/facebook/pyrefly/how-pyrefly-perform-type-inference-empty-containers)

Discover how Pyrefly handles type inference for empty containers using placeholder variables and lazy unification. Learn how it defers type resolution until containers are used.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Handles Jaxtyping Tensor Shape Annotations: A Deep Dive into the Type System](/facebook/pyrefly/how-pyrefly-handle-jaxtyping-tensor-shape-annotations)

Discover how Pyrefly handles Jaxtyping tensor shape annotations by parsing wrapper classes, tokenizing shapes, and converting to its internal TensorType. Learn about its syntax tracking.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles Enum Members and Their Literal Types](/facebook/pyrefly/how-pyrefly-handle-enum-members-literal-types)

Discover how Pyrefly models enum members as singleton literal types, converting them to TSP class types with the LITERAL flag for precise type narrowing and attribute resolution.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Handles Dataclass Transformations and Field Metadata](/facebook/pyrefly/how-pyrefly-handle-dataclass-transformations-field-metadata)

Discover how Pyrefly transforms dataclasses and manages field metadata. Learn about its approach to decorator arguments, method synthesis, and constraint enforcement for robust class handling.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles TypedDict total and non-total Requirements](/facebook/pyrefly/how-pyrefly-handle-typeddict-total-non-total-requirements)

Discover how Pyrefly manages TypedDict total and non-total requirements. Learn about its class-based approach, flag initialization, and metadata merging for field constraints and inheritance.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles ParamSpec and TypeVarTuple for Callable Generics](/facebook/pyrefly/how-pyrefly-handle-param-spec-typevar-tuple-callable-generics)

Learn how Pyrefly processes ParamSpec and TypeVarTuple for callable generics. Discover its Typed Syntax Process for handling variadic generic signatures.

- Tags: internals
- Published: 2026-05-21

### [Pyrefly Configuration Options: Complete Guide to Setup and mypy/pyright Migration](/facebook/pyrefly/pyrefly-configuration-options-interaction-mypy-pyright)

Explore Pyrefly configuration options in pyrefly.toml or pyproject.toml. Learn how Pyrefly migrates mypy and pyright settings for seamless setup and enhanced code analysis.

- Tags: how-to-guide
- Published: 2026-05-21

### [How Pyrefly Implements Its Language Server Protocol: A Deep Dive into the Rust LSP Architecture](/facebook/pyrefly/how-pyrefly-implement-language-server-protocol)

Discover how Pyrefly implements its Language Server Protocol with a pure-Rust server, parallel TSP bridge, and three-layer architecture for real-time IDE features.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles Django ORM Models, QuerySets, and View Decorators](/facebook/pyrefly/how-pyrefly-handle-django-orm-models-querysets-view-decorators)

Discover how Pyrefly handles Django ORM models, QuerySets, and view decorators by analyzing type stubs and applying a generic type solver for precise type propagation without hardcoding.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Supports Pydantic Models: Configuration Extraction and Constraint Validation](/facebook/pyrefly/how-pyrefly-support-pydantic-models)

Learn how Pyrefly supports Pydantic models by extracting configuration and validating constraints through a three-stage pipeline for Pydantic-compatible diagnostics.

- Tags: deep-dive
- Published: 2026-05-21

### [How Pyrefly Handles Module-Level Incrementality and Parallelism for Large Codebases](/facebook/pyrefly/how-pyrefly-handle-module-level-incrementality-parallelism-large-codebases)

Learn how Pyrefly manages module-level incrementality and parallelism for large codebases using a per module state machine and a configurable Rayon based thread pool for efficient type checking.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Implements Type Narrowing and Refinement in Its Flow Type System](/facebook/pyrefly/how-pyrefly-implement-type-narrowing-refinement-flow-type-system)

Discover how Pyrefly implements type narrowing and refinement in its flow type system. Learn about parsing guard expressions, composing predicates, and attaching flow state for precise type refinement across branches.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly Handles Type Variable Resolution With Recursive Types](/facebook/pyrefly/how-pyrefly-handle-type-variable-resolution-recursive-types)

Pyrefly resolves type variables in recursive types using a co-inductive solver. Discover how it prevents infinite loops and caches subset checks for efficient expansion.

- Tags: internals
- Published: 2026-05-21

### [How Pyrefly's Three-Phase Type Checking Architecture Works](/facebook/pyrefly/how-pyrefly-three-phase-type-checking-architecture-works)

Discover how Pyrefly's three-phase type checking architecture Export Binding and Solving works. It builds intermediate representations and resolves types with placeholder-based recursion.

- Tags: internals
- Published: 2026-05-21

