Skip to content

Commit 6bc3933

Browse files
authored
Fix find_node_by_weight type annotations (#1324)
1 parent d21fe54 commit 6bc3933

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed a bug in the type hints for :meth:`~rustworkx.PyGraph.find_node_by_weight`
5+
and :meth:`~rustworkx.PyDiGraph.find_node_by_weight`.
6+
Refer to `issue 1243 <https://github.com/Qiskit/rustworkx/issues/1322>`__ for
7+
more information.

rustworkx/rustworkx.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ class PyGraph(Generic[_S, _T]):
12241224
def filter_nodes(self, filter_function: Callable[[_S], bool]) -> NodeIndices: ...
12251225
def find_node_by_weight(
12261226
self,
1227-
obj: Callable[[_S], bool],
1227+
obj: _S,
12281228
/,
12291229
) -> int | None: ...
12301230
@staticmethod
@@ -1378,7 +1378,7 @@ class PyDiGraph(Generic[_S, _T]):
13781378
def find_adjacent_node_by_edge(self, node: int, predicate: Callable[[_T], bool], /) -> _S: ...
13791379
def find_node_by_weight(
13801380
self,
1381-
obj: Callable[[_S], bool],
1381+
obj: _S,
13821382
/,
13831383
) -> int | None: ...
13841384
def find_predecessors_by_edge(

0 commit comments

Comments
 (0)