Open Source & Case StudiesMICROSOFT PYRIGHT · 4 APPROVALS · PR #11605
MERGED UPSTREAM

Inherited Asymmetric Descriptor Detection & MRO Type Specialization in Microsoft Pyright

Engineered MRO type specialization for inherited properties in Microsoft Pyright (the core type engine powering VS Code Pylance). Solved false-positive type diagnostic errors by accurately differentiating asymmetric getter and setter types across Python class inheritance hierarchies.

Role

  • TypeScript Systems Engineering
  • Type Inference
  • Python Static Analysis
  • MRO Resolution
  • source-level Evaluation

Category

Type Evaluation & Static Analysis

Engineering discipline

MERGED UPSTREAM

Public PR:PR #11605 · approved
Maintainer Approvals:4 Approvals
Issue Resolved:#11599
Microsoft Pyright Asymmetric Descriptors PR #11605 contribution by Patrick Ribbsaeter

Patrick Ribbsaeter · Independent open-source contribution

Engineering objective

System challenge

When Python classes inherit properties with asymmetric getter and setter types across complex method resolution orders (MRO), Pyright assumed symmetric type bounds on property access, emitting invalid diagnostic errors on valid assignments and reads.

Constraints

Working within real limits

  • ✕Preserve full compliance with Python typing PEPs (PEP 484, PEP 544, PEP 681)
  • ✕Zero performance regression in Pyright type check latency across multi-million line codebases
  • ✕Handle multiple inheritance and diamond MRO patterns deterministically
  • ✕Pass full Pyright Jest, tsc, and regression test suites

Approach

How it was built

  1. 01

    Specialized property getter types across class MRO hierarchies during static attribute evaluation.

  2. 02

    Differentiated asymmetric getter/setter signatures during member access and mutation.

  3. 03

    Authored regression coverage covering complex inheritance, descriptor protocols, and protocol conformance.

  4. 04

    Resolved upstream merge collisions and validated with 100% clean test passes.

Technical validation

Implementation evidence

Observable engineering evidence. Discipline: MERGED UPSTREAM

Public PR

PR #11605 · approved

Maintainer Approvals

4 Approvals

Issue Resolved

#11599

Engine

Microsoft Pyright / Pylance

Test Pass

100% Clean

Public evidence

Review the upstream contribution

Outcome

What was delivered

  • Eliminated false-positive diagnostics for inherited asymmetric descriptor properties

  • Received 4 maintainer approvals across core Pyright team, marked mergeable

  • 100% pass across complete Pyright test battery

Technologies

Stack and tools

TypeScriptMicrosoft PyrightVS Code PylanceType EvaluationPython source-levelStatic Analysis

Explore Engineering Systems

Previous and Next Engineering Systems

Have an ambitious AI system to build?

Let’s build something serious.

I work across AI architecture, product engineering, private inference, automation, SaaS infrastructure, and production hardening.