# 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-10-11, python/mypy contains 316,066 total lines (245,151 code) across 1,375 files, while microsoft/pyright contains 564,704 total lines (482,806 code) across 5,834 files as of 2026-10-10. 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,375 | 5,834 |
| Total lines | 316,066 | 564,704 |
| Code lines | 245,151 | 482,806 |
| Comment lines | 34,288 | 23,464 |
| Blank lines | 36,627 | 58,434 |
| Languages counted | 12 | 9 |

Top languages in python/mypy: Python (81.7% of code), C Header (8.8% of code), C (6.5% of code). Top languages in microsoft/pyright: Python (66.9% of code), TypeScript (27.0% 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 e3003dd8761c) on 2026-10-11; microsoft/pyright was counted at ref main (commit 543798c27937) on 2026-10-10. 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: 482,806 code lines versus 245,151 for python/mypy, about 2.0x as much, based on cached OctoCounts reports as of 2026-10-11.

### 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 e3003dd8761c) on 2026-10-11; microsoft/pyright was counted at ref main (commit 543798c27937) on 2026-10-10. 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)
