mypy vs Pyright: source lines of code compared

This page compares the source lines of code (SLOC) of python/mypy and microsoft/pyright using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-08-26, python/mypy contains 310,011 total lines (242,271 code) across 1,368 files, while microsoft/pyright contains 572,386 total lines (491,828 code) across 5,694 files as of 2026-08-26. microsoft/pyright is about 2.0x the size of python/mypy by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricpython/mypymicrosoft/pyright
Files1,3685,694
Total lines310,011572,386
Code lines242,271491,828
Comment lines31,93822,983
Blank lines35,80257,575
Languages counted129

Top languages in python/mypy: Python (81.7% of code), C Header (8.9% of code), C (6.4% of code). Top languages in microsoft/pyright: Python (63.8% of code), TypeScript (25.0% of code), JSON (9.3% of code). Python, TOML appear in both top language lists; C Header, C, C++ appear only in python/mypy's top languages; TypeScript, JSON, YAML appear only in microsoft/pyright's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. python/mypy was counted at ref master (commit 1dab3c5f3d4c) on 2026-08-26; microsoft/pyright was counted at ref main (commit 37c03866d792) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Evidence and next steps:

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, python/mypy or microsoft/pyright?

microsoft/pyright has more code: 491,828 code lines versus 242,271 for python/mypy, about 2.0x as much, based on cached OctoCounts reports as of 2026-08-26.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for python/mypy, microsoft/pyright, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. python/mypy was counted at ref master (commit 1dab3c5f3d4c) on 2026-08-26; microsoft/pyright was counted at ref main (commit 37c03866d792) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.