diff --git a/releasenotes/notes/fix-find-node-by-weight-stub-94e971291e1e6c96.yaml b/releasenotes/notes/fix-find-node-by-weight-stub-94e971291e1e6c96.yaml new file mode 100644 index 000000000..cc99652c3 --- /dev/null +++ b/releasenotes/notes/fix-find-node-by-weight-stub-94e971291e1e6c96.yaml @@ -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 `__ for + more information. diff --git a/rustworkx/rustworkx.pyi b/rustworkx/rustworkx.pyi index 4a18edd61..5d4219706 100644 --- a/rustworkx/rustworkx.pyi +++ b/rustworkx/rustworkx.pyi @@ -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 @@ -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(