Open jlhamilton777 opened 3 days ago
We can replace the signature with PyDiGraph[Any,Any]
, but honestly that is a pyright quirk from https://github.com/microsoft/pyright/discussions/5101.
Mypy treat it as Any
which is what we tested for. I’ll explore how Pyre and Pytype treat it so we can have a solution that works well with most type checkers
Information
What is the current behavior?
Pyright is unable to fully type check the
rustworkx.ancestors()
function in strict mode.What is the expected behavior?
Pyright should be able to determine the type of
ancestors()
, including the parameterized type of thegraph
parameter.Steps to reproduce the problem
I looked at the stub file https://github.com/Qiskit/rustworkx/blob/553bff1823a30293c82fb811f4457b094700a728/rustworkx/rustworkx.pyi#L985-L990 and
graph
doesn't havePyDiGraph[_S, _T]
like in some of the other functions. I also ran into this issue with thedescendants()
function.