<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh" -->

---
title: What's type-coverage, and why should I care? | daily.dev
description: Pyrefly, a fast Python type-checker, includes a lesser-known feature called type-coverage that measures what percentage of a project's typable elements...
canonical: https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What's type-coverage, and why should I care? | daily.dev
og:description: Pyrefly, a fast Python type-checker, includes a lesser-known feature called type-coverage that measures what percentage of a project's typable elements...
og:url: https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh
og:image: https://api.daily.dev/og/posts/br4V8jNdH.png
og:image:alt: What's type-coverage, and why should I care?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What's type-coverage, and why should I care?

**[Pyrefly: A Fast Python Type Checker and Language Server \| Pyrefly](https://daily.dev/sources/pyrefly)** · 4 min read · 0 upvotes · 0 comments

## Summary

Pyrefly, a fast Python type-checker, includes a lesser-known feature called type-coverage that measures what percentage of a project's typable elements (function arguments, return types, class variables, constants) have type annotations. Unlike Ruff's ANN rules or a plain type-check run, pyrefly coverage can detect missing entries in stub files, enforce explicit typing on class variables with non-trivial __init__ logic, and let developers focus effort using a --public-only flag. It's fast enough for pre-commit hooks and is already used by projects like NumPy, Polars, Narwhals, scipy-stubs, and sh.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pyrefly.org/blog/why-type-coverage>

## Questions this post answers

### What is type coverage in Python and how is it different from test coverage?

Type coverage measures what percentage of a project's typable elements—function arguments, return types, class variables, and constants—have type annotations, analogous to how test coverage measures code hit by tests. Local variables inside function bodies are excluded since users never interact with them directly. Tools like pyrefly coverage can also restrict the measurement to public-only typables with a flag.

_Developers tightening up type coverage on a Python codebase can find practical tooling guidance like this on daily.dev._

### Why isn't Ruff's ANN linting rule enough to catch missing type annotations in stub files?

Ruff's ANN rules only flag unannotated parameters or return types present in a file, but they cannot detect an entire function missing from a .pyi stub file. Since the typing spec requires type checkers to use only the stub file when one exists, an incomplete stub silently hides functions from type checking. pyrefly coverage catches this gap by comparing stub completeness against the real module.

_When choosing linting versus type-coverage tools for stub maintenance, daily.dev helps developers compare approaches._

### Which major Python projects use pyrefly coverage to track type annotation completeness?

Pyrefly coverage is already used by scipy-stubs, NumPy, Polars, Narwhals, and the sh library to track and prioritize their type annotation efforts. NumPy specifically used the tool's coverage reports to prioritize which parts of its codebase to type first, focusing effort on the highest-yield public typables.

_Developers deciding whether to adopt a new type-coverage tool can track real-world adoption cases via daily.dev._

## Similar posts on daily.dev

- [Pyrefly Now Type Checks PyTorch – PyTorch](https://daily.dev/posts/pyrefly-now-type-checks-pytorch-pytorch-adohlgdfc) · PyTorch · 0 upvotes · 0 comments
- [Pyrefly 1.0: A fast, forward-looking Python linter](https://daily.dev/posts/pyrefly-1-0-a-fast-forward-looking-python-linter-k4vukcqpr) · InfoWorld · 0 upvotes · 0 comments
- [Python Type Checker Comparison: Typing Spec Conformance](https://daily.dev/posts/python-type-checker-comparison-typing-spec-conformance-yvjkxqkwd) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What's type-coverage, and why should I care?","url":"https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh"},"datePublished":"2026-08-23T12:17:04.651Z","dateModified":"2026-08-23T12:20:02.246Z","description":"Pyrefly, a fast Python type-checker, includes a lesser-known feature called type-coverage that measures what percentage of a project's typable elements...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","logo":"https://media.daily.dev/image/upload/s--Qzw5NpnF--/c_limit,w_256/f_auto,q_auto/v1787487420/logos/pyrefly?_a=BAMAMicg0","url":"https://daily.dev/sources/pyrefly"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","item":"https://daily.dev/sources/pyrefly"},{"@type":"ListItem","position":3,"name":"What's type-coverage, and why should I care?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh#faq","mainEntity":[{"@type":"Question","name":"What is type coverage in Python and how is it different from test coverage?","acceptedAnswer":{"@type":"Answer","text":"Type coverage measures what percentage of a project's typable elements—function arguments, return types, class variables, and constants—have type annotations, analogous to how test coverage measures code hit by tests. Local variables inside function bodies are excluded since users never interact with them directly. Tools like pyrefly coverage can also restrict the measurement to public-only typables with a flag. Developers tightening up type coverage on a Python codebase can find practical tooling guidance like this on daily.dev."}},{"@type":"Question","name":"Why isn't Ruff's ANN linting rule enough to catch missing type annotations in stub files?","acceptedAnswer":{"@type":"Answer","text":"Ruff's ANN rules only flag unannotated parameters or return types present in a file, but they cannot detect an entire function missing from a .pyi stub file. Since the typing spec requires type checkers to use only the stub file when one exists, an incomplete stub silently hides functions from type checking. pyrefly coverage catches this gap by comparing stub completeness against the real module. When choosing linting versus type-coverage tools for stub maintenance, daily.dev helps developers compare approaches."}},{"@type":"Question","name":"Which major Python projects use pyrefly coverage to track type annotation completeness?","acceptedAnswer":{"@type":"Answer","text":"Pyrefly coverage is already used by scipy-stubs, NumPy, Polars, Narwhals, and the sh library to track and prioritize their type annotation efforts. NumPy specifically used the tool's coverage reports to prioritize which parts of its codebase to type first, focusing effort on the highest-yield public typables. Developers deciding whether to adopt a new type-coverage tool can track real-world adoption cases via daily.dev."}}]}
```

