You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import rustworkx as rx
----> graph: rx.PyDiGraph[str, str] = rx.PyDiGraph()
TypeError: 'type' object is not subscriptable
What is the expected behavior?
It seems that other users manage to use type hinting as shown in #1242. I can't understand why it doesn't work on both systems I tested, and I can't find anything in the documentation about it.
Thank you very much for your answer. I apologize for not trying the from __future__ import annotations earlier. I can confirm that using this approach works on Python versions 3.9 through 3.12. However, without using the __future__ import, the code still doesn't work, even on Python 3.12.4 (I just created a brand new environment for testing this).
That said, this solution does indeed solve the problem for me. Thank you!
Information
What is the current behavior?
What is the expected behavior?
It seems that other users manage to use type hinting as shown in #1242. I can't understand why it doesn't work on both systems I tested, and I can't find anything in the documentation about it.
Steps to reproduce the problem
Go to Google Colab and run:
The text was updated successfully, but these errors were encountered: