For __init__.pyi, pyrefly report outputs
{
"kind": "function",
"name": "numpy.ndarray.__array_wrap__",
"n_typable": 4,
"n_typed": 4,
"n_any": 0,
"n_untyped": 0,
"location": {
"line": 2138,
"column": 5
}
},
So it correctly counts ndarray.__array_wrap__ as fully typed.
However, for core/defchararray.pyi, it outputs
{
"kind": "function",
"name": "numpy._core.defchararray.chararray.__array_wrap__",
"n_typable": 4,
"n_typed": 0,
"n_any": 0,
"n_untyped": 4,
"location": {
"line": 582,
"column": 5
}
},
The chararray here is a subclass of ndarray. Because the chararray.__array_wrap__ method has the same signature as ndarray.__array_wrap__, there is no need to override it in the stubs.
Yet pyrefly report counts chararray.__array_wrap__, which is statically the very same method as ndarray.__array_wrap__, as fully untyped.
I suspect that the issue is that pyrefly report looks at the .py, sees that there's a chararray.__array_wrap__ method. It then, without considering the superclass, "requires" that chararray.__array_wrap__ must also exists in the stubs.
For
__init__.pyi,pyrefly reportoutputs{ "kind": "function", "name": "numpy.ndarray.__array_wrap__", "n_typable": 4, "n_typed": 4, "n_any": 0, "n_untyped": 0, "location": { "line": 2138, "column": 5 } },So it correctly counts
ndarray.__array_wrap__as fully typed.However, for
core/defchararray.pyi, it outputs{ "kind": "function", "name": "numpy._core.defchararray.chararray.__array_wrap__", "n_typable": 4, "n_typed": 0, "n_any": 0, "n_untyped": 4, "location": { "line": 582, "column": 5 } },The
chararrayhere is a subclass ofndarray. Because thechararray.__array_wrap__method has the same signature asndarray.__array_wrap__, there is no need to override it in the stubs.Yet
pyrefly reportcountschararray.__array_wrap__, which is statically the very same method asndarray.__array_wrap__, as fully untyped.I suspect that the issue is that
pyrefly reportlooks at the.py, sees that there's achararray.__array_wrap__method. It then, without considering the superclass, "requires" thatchararray.__array_wrap__must also exists in the stubs.