mypy vs Pyright: source lines of code compared

The mypy vs Pyright comparison on OctoCounts shows side-by-side source line counts for python/mypy and microsoft/pyright, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

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-11-16, python/mypy contains 323,204 total lines (251,121 code) across 1,377 files, while microsoft/pyright contains 577,533 total lines (494,143 code) across 5,873 files as of 2026-11-13. microsoft/pyright has about 2.0x the counted code lines of python/mypy under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricpython/mypymicrosoft/pyright
Files1,3775,873
Total lines323,204577,533
Code lines251,121494,143
Comment lines34,90323,927
Blank lines37,18059,463
Languages counted1710

Top languages in python/mypy: Python (81.4% of code), C Header (8.9% of code), C (6.8% of code). Top languages in microsoft/pyright: Python (65.4% of code), TypeScript (28.5% of code), JSON (4.1% 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 17f7a85d929a) on 2026-11-16; microsoft/pyright was counted at ref main (commit baf130b28df7) on 2026-11-13. See the counting methodology for ignored directories and analysis options.

Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. python/mypy: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. microsoft/pyright: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

About this comparison

Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: python/mypy is the mypy repository: the static type checker for Python, implemented in Python (with compiled components via mypyc), plus its extensive test and conformance suites. microsoft/pyright is the Pyright repository: a static type checker for Python implemented in TypeScript/JavaScript, packaged as both a CLI and a language server, with its own test suites. Both check the same language from different implementation stacks, counted on the dates above.

The per-language tables capture the well-known implementation split: mypy's counted tree is predominantly Python, while Pyright's is predominantly TypeScript — two different languages used to build tools that analyze the same one.

Implementation language and repository size do not determine checking speed, memory use, or diagnostic quality; those depend on the shipped tool and how it is run (CLI, daemon, or language server), none of which is measured by these counts.

Sources: python/mypy repository (Python-implemented type checker) · microsoft/pyright repository (TypeScript-implemented type checker). Statements verified 2026-09-16.

Evidence and next steps:

Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.

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?

As of 2026-11-16, python/mypy contains 323,204 total lines (251,121 code) across 1,377 files, while microsoft/pyright contains 577,533 total lines (494,143 code) across 5,873 files as of 2026-11-13. microsoft/pyright has about 2.0x the counted code lines of python/mypy under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

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 17f7a85d929a) on 2026-11-16; microsoft/pyright was counted at ref main (commit baf130b28df7) on 2026-11-13. 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.