Skip to content
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

Wrong type annotation for find_node_by_weight #1322

Open
BarakKatzir opened this issue Nov 19, 2024 · 1 comment · May be fixed by #1324
Open

Wrong type annotation for find_node_by_weight #1322

BarakKatzir opened this issue Nov 19, 2024 · 1 comment · May be fixed by #1324
Labels
bug Something isn't working

Comments

@BarakKatzir
Copy link

Information

  • rustworkx version: 0.15.1
  • Python version: 3.12

What is the current behavior?

Wrong annotation in rustworkx/rustworkx/rustworkx.pyi

def find_node_by_weight(
        self,
        obj: Callable[[_S], bool],
        /,
    ) -> int | None: ...

What is the expected behavior?

Correct to

def find_node_by_weight(self, obj: _S, /) -> int | None: ...
@BarakKatzir BarakKatzir added the bug Something isn't working label Nov 19, 2024
@IvanIsCoding
Copy link
Collaborator

IvanIsCoding commented Nov 19, 2024

All out methods are manually annotated so you found a bug. For the JSON function it is a known issue (#1243 ) and the fix is already merged in the main branch.

find_node_by_weight is new though, we should send a PR to fix it

@IvanIsCoding IvanIsCoding changed the title Wrong type annotation for find_node_by_weight and node_link_json Wrong type annotation for find_node_by_weight Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants