-
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
PyGraph not typed correctly in VSCode, disallowing autocomplete #832
Comments
We just merged #401 which should fix that. It has not been released yet. Would you mind installing from the main branch and sharing what you see? |
See my previous comment - I can't index into PyGraph (not subscriptable). That's the error i get when I'm adding the type hint. |
This is related to PEP 563, the following code works: from __future__ import annotations
import rustworkx as rx
g: rx.PyGraph[tuple[int, int], float] = rx.PyGraph() # this typing is very cool
n1 = g.add_node((1,2))
n2 = g.add_node((3,4))
g.add_edge(n1, n2, 10) |
Information
rustworkx version: 0.12.1
Python version: 3.10.9
Rust version: Not installed, installed via wheel
Operating system:
Debian Buster
What is the current behavior?
VSCode is unable to parse the type of PyGraph, see below.
This makes it very difficult to write code, especially while getting used to a new API.
Autocompletion works in iPython, and assumedly, the Jupyter Notebook (both use Jedi).
What is the expected behavior?
VSCode should identify the type of the graph
Steps to reproduce the problem
In VSCode:
The text was updated successfully, but these errors were encountered: