Skip to content

pyrefly report: should external symbols count towards type coverage? #3102

@jorenham

Description

@jorenham

Typestats basically ignores symbols defined outside of the projects (except for a select few from typing[_extensions] and _typeshed). The reasoning here is that if those symbols are untyped, then there's nothing the user can do about it. That's why typestats doesn't include those in the reported counts and coverage. This avoids situations similar to how pyright --verifytypes, will never be 100% if you have an import numbers somewhere in your code. Pyright has an --excludeexternal flag for this to ignore such cases, but as far as I've seen, everyone always enables this flag.

I guess there's also something to be said for reporting transitively untyped symbols, but I can see how it's easier to reason about type-coverage if it's limited to the target project.

I suppose that a --excludeexternal flag like pyright has would be most flexible, but it's probably easier to always ignore external dependencies, like typestats currently does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions