# 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 with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, python/mypy contains 311,177 total lines (243,223 code) across 1,370 files, while microsoft/pyright contains 555,716 total lines (474,579 code) across 5,817 files as of 2026-09-16. 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.

| Metric | [python/mypy](https://octocounts.com/github/python/mypy) | [microsoft/pyright](https://octocounts.com/github/microsoft/pyright) |
| --- | ---: | ---: |
| Files | 1,370 | 5,817 |
| Total lines | 311,177 | 555,716 |
| Code lines | 243,223 | 474,579 |
| Comment lines | 32,041 | 23,135 |
| Blank lines | 35,913 | 58,002 |
| Languages counted | 12 | 9 |

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 (68.0% of code), TypeScript (25.9% 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 cd677205658299a81c7052a96d5c83349cb2aed1 (commit cd6772056582) on 2026-09-16; microsoft/pyright was counted at ref 8854cffd75d69c2bb499e2b3c8eda8cf21ef8d4b (commit 8854cffd75d6) on 2026-09-16. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

python/mypy counts 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 counts 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.

Both repositories devote a large share of their trees to test and conformance material for Python typing rules, so a meaningful part of each count exists to pin down type-system behavior rather than to ship to users.

_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)](https://github.com/python/mypy) · [microsoft/pyright repository (TypeScript-implemented type checker)](https://github.com/microsoft/pyright). Statements verified 2026-09-16.

Evidence and next steps:

- [python/mypy SLOC report](https://octocounts.com/github/python/mypy)
- [microsoft/pyright SLOC report](https://octocounts.com/github/microsoft/pyright)
- [Compare python/mypy and microsoft/pyright interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy&right=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpyright)

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: 474,579 code lines versus 243,223 for python/mypy, about 2.0x as much, based on cached OctoCounts reports as of 2026-09-16.

### 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 cd677205658299a81c7052a96d5c83349cb2aed1 (commit cd6772056582) on 2026-09-16; microsoft/pyright was counted at ref 8854cffd75d69c2bb499e2b3c8eda8cf21ef8d4b (commit 8854cffd75d6) on 2026-09-16. 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.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
