Skip to content

pyrefly report should have a way to associate .pyi definition with .py one #2256

@MarcoGorelli

Description

@MarcoGorelli

If I run pyrefly report numpy and then search for .polyval", then here's what I see:

  "/home/marcogorelli/numpy-dev/numpy/polynomial/polynomial.py": {
[...]
     {
        "name": "numpy.polynomial.polynomial.polyval",
[...]
  "/home/marcogorelli/numpy-dev/numpy/lib/_polynomial_impl.py": {
[...]
        "name": "numpy.lib._polynomial_impl.polyval",
  "/home/marcogorelli/numpy-dev/numpy/lib/_polynomial_impl.pyi": {
[...]
        "name": "numpy.lib._polynomial_impl.polyval",
[...]

In Python, if I run

from typing import reveal_type
from numpy.polynomial.polynomial import polyval

reveal_type(polyval(1, [1,2,3]))

then Pyrefly type-checks it correctly:

$ pyrefly check t.py 
 INFO revealed type: floating[Any] [reveal-type]
 --> t.py:4:12
  |
4 | reveal_type(polyval(1, [1,2,3]))
  |            ---------------------
  |
 INFO 0 errors

So, pyrefly knows that numpy.polynomial.polynomial.polynomial is defined in numpy.lib._polynomial_impl.polyval in the stubs

Is there a way to get pyrefly report to reflect this, so that we can match them up when computing the completeness score?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions