-
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
Improvements for rustworkx.visit annotations #1362
Improvements for rustworkx.visit annotations #1362
Conversation
@@ -42,6 +39,11 @@ if sys.version_info >= (3, 13): | |||
else: | |||
from typing_extensions import TypeVar | |||
|
|||
if sys.version_info >= (3, 11): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not strictly necessary but I noticed we could refactor this to avoid depending on typing_extension
for 3.13
class StopSearch(Exception): ... | ||
class PruneSearch(Exception): ... | ||
|
||
_T = TypeVar("_T") | ||
_T = TypeVar("_T", default=Any) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This silences pyright in strict mode like reported in #1352
This reverts commit 499ea56.
Overloading is harder than I thought. https://github.com/Qiskit/rustworkx/actions/runs/12780463862/job/35626988746 had quite a lot of errors. Let's try to merge a smaller PR first with some obvious, correct improvements. I will study more on the overloads side to try to fix the issues in a separate PR. edit: I described a possible fix in #1361 (comment). So indeed, we'll need a separate PR. Let's keep this one simple |
Related to #1352 and #1361
This is kind of a mix of using
TypeVar
's default argumentwith some feedback to mitigate the issue introduced in #787 that made us realize that the order of the arguments in the signature was wrong