-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bfs_search
, etc. have incorrect type stubs
#1130
Comments
I carried out a quick experiment, and it seems that arbitrary |
Because our library is written in Rust we had to manually add the type stubs. Not only did I get In the meantime you will need to ignore the annotation if you are using mypy/pyright/etc |
Hi @IvanIsCoding. |
Sounds good. Check https://github.com/Qiskit/rustworkx/blob/main/CONTRIBUTING.md. You will need to generate a release note + change the rustworkx.pyi + init.pyi files. If you include universal and type-specific functions for Dijkstra, BFS, and DFS they will be 9 in total |
I will try to target release the fix for this with the fix for #1117 in 0.14.2 |
rustworkx/src/traversal/mod.rs
Lines 424 to 429 in 6e37baf
source
is anOptional<Vec<usize>>
but the Python type stubs show the binding taking a singleint
:rustworkx/rustworkx/__init__.pyi
Lines 552 to 556 in 6e37baf
The examples in the documentation (correctly) show singleton lists being passed:
rustworkx/rustworkx/__init__.py
Line 1533 in 6e37baf
If a single
int
is passed, thenis raised.
I'm not familar enough with PyO3 to know whether it would allow implicit conversions of any
Iterable[int]
; this page implies it needs to be alist
, but the error message (which comes from PyO3) implies it might acceptcollections.abc.Sequence
or something similar.The text was updated successfully, but these errors were encountered: