Skip to content

pyrefly report: "n_any" is too high #3096

@jorenham

Description

@jorenham

In typestats, the thought process behind the "n_any" counts, is b x: Any is equivalent to an untyped x. So in that sense it's (strictly speaking) not "typed". So typestats only considers something "any" when it's "100% any".

However, pyrefly report seems to also count e.g. x: np.floating, which is equivalent to np.floating[Any], as "any". The consequence is that in scipy-stubs the strict coverage is below 50%, even though the non-strict coverage is 100%. And according to typestats, the strict coverege of scipoy-stubs is 99.7%: https://jorenham.github.io/typestats/dashboard/

So I propose that pyrefly report only counts an annotations as any if it's "100% any", like typstats 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