Skip to content

Commit

Permalink
Fix find_node_by_weight type annotations (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIsCoding authored Dec 17, 2024
1 parent d21fe54 commit 6bc3933
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixed a bug in the type hints for :meth:`~rustworkx.PyGraph.find_node_by_weight`
and :meth:`~rustworkx.PyDiGraph.find_node_by_weight`.
Refer to `issue 1243 <https://github.com/Qiskit/rustworkx/issues/1322>`__ for
more information.
4 changes: 2 additions & 2 deletions rustworkx/rustworkx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ class PyGraph(Generic[_S, _T]):
def filter_nodes(self, filter_function: Callable[[_S], bool]) -> NodeIndices: ...
def find_node_by_weight(
self,
obj: Callable[[_S], bool],
obj: _S,
/,
) -> int | None: ...
@staticmethod
Expand Down Expand Up @@ -1378,7 +1378,7 @@ class PyDiGraph(Generic[_S, _T]):
def find_adjacent_node_by_edge(self, node: int, predicate: Callable[[_T], bool], /) -> _S: ...
def find_node_by_weight(
self,
obj: Callable[[_S], bool],
obj: _S,
/,
) -> int | None: ...
def find_predecessors_by_edge(
Expand Down

0 comments on commit 6bc3933

Please sign in to comment.