From 7f29ef32b7596231fc5e76dedc4dac6ab5ecba08 Mon Sep 17 00:00:00 2001 From: saixiaoxi <101516994+saixiaoxi@users.noreply.github.com> Date: Thu, 28 May 2026 16:31:42 +0800 Subject: [PATCH 1/3] docs: remove stale bipartite doctest fixmes --- graphs/check_bipatrite.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/graphs/check_bipatrite.py b/graphs/check_bipatrite.py index 897c78850d58..afd2a41c3079 100644 --- a/graphs/check_bipatrite.py +++ b/graphs/check_bipatrite.py @@ -33,7 +33,6 @@ def is_bipartite_dfs(graph: dict[int, list[int]]) -> bool: >>> is_bipartite_dfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}) False - >>> # FIXME: This test should fails with KeyError: 4. >>> is_bipartite_dfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) False >>> is_bipartite_dfs({0: [-1, 3], 1: [0, -2]}) @@ -43,8 +42,6 @@ def is_bipartite_dfs(graph: dict[int, list[int]]) -> bool: >>> is_bipartite_dfs({0.9: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2]}) True - >>> # FIXME: This test should fails with - >>> # TypeError: list indices must be integers or... >>> is_bipartite_dfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]}) True >>> is_bipartite_dfs({"a": [1, 3], "b": [0, 2], "c": [1, 3], "d": [0, 2]}) @@ -113,7 +110,6 @@ def is_bipartite_bfs(graph: dict[int, list[int]]) -> bool: >>> is_bipartite_bfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}) False - >>> # FIXME: This test should fails with KeyError: 4. >>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) False >>> is_bipartite_bfs({0: [-1, 3], 1: [0, -2]}) @@ -123,8 +119,6 @@ def is_bipartite_bfs(graph: dict[int, list[int]]) -> bool: >>> is_bipartite_bfs({0.9: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2]}) True - >>> # FIXME: This test should fails with - >>> # TypeError: list indices must be integers or... >>> is_bipartite_bfs({0: [1.0, 3.0], 1.0: [0, 2.0], 2.0: [1.0, 3.0], 3.0: [0, 2.0]}) True >>> is_bipartite_bfs({"a": [1, 3], "b": [0, 2], "c": [1, 3], "d": [0, 2]}) From 89a5089b863541147e5dfc21bdd3b1d3ef7483d0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 24 Sep 2026 15:13:00 +0200 Subject: [PATCH 2/3] Add additional test cases for bipartite functions --- graphs/check_bipatrite.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphs/check_bipatrite.py b/graphs/check_bipatrite.py index 2dcd824207d0..4d8e6d7b57d3 100644 --- a/graphs/check_bipatrite.py +++ b/graphs/check_bipatrite.py @@ -32,6 +32,7 @@ def is_bipartite_dfs(graph: dict[int, list[int]]) -> bool: False >>> is_bipartite_dfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}) False + >>> is_bipartite_dfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) False >>> is_bipartite_dfs({0: [-1, 3], 1: [0, -2]}) @@ -108,6 +109,7 @@ def is_bipartite_bfs(graph: dict[int, list[int]]) -> bool: >>> is_bipartite_bfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}) False >>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) + False >>> is_bipartite_bfs({0: [-1, 3], 1: [0, -2]}) False From 84f97526bf2c606774b98f2c6be2687e7350521c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 24 Sep 2026 15:13:49 +0200 Subject: [PATCH 3/3] Fix indentation in is_bipartite_bfs docstring examples --- graphs/check_bipatrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphs/check_bipatrite.py b/graphs/check_bipatrite.py index 4d8e6d7b57d3..db9626d197ad 100644 --- a/graphs/check_bipatrite.py +++ b/graphs/check_bipatrite.py @@ -108,8 +108,8 @@ def is_bipartite_bfs(graph: dict[int, list[int]]) -> bool: False >>> is_bipartite_bfs({7: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: [0]}) False - >>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) + >>> is_bipartite_bfs({0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 9: [0]}) False >>> is_bipartite_bfs({0: [-1, 3], 1: [0, -2]}) False