From 07f28389b6fe78daddce15f8c32ffe2665d326c8 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 5 Mar 2025 22:14:08 -0500 Subject: [PATCH 1/2] EdgeComponentAuxGraph.construct first param is not cls at runtime --- .../networkx/algorithms/connectivity/edge_kcomponents.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi index 67927d5cb64a..8eca2373a9dd 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete from collections.abc import Generator +from typing import Self from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable @@ -16,6 +17,6 @@ class EdgeComponentAuxGraph: H: Incomplete @classmethod - def construct(cls, G): ... + def construct(EdgeComponentAuxGraph, G) -> Self: ... def k_edge_components(self, k: int) -> Generator[Incomplete, Incomplete, None]: ... def k_edge_subgraphs(self, k: int) -> Generator[Incomplete, Incomplete, None]: ... From ae70c0fb2fca37c2e291cd9c01be8467a95731e1 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 5 Mar 2025 22:18:32 -0500 Subject: [PATCH 2/2] Fix Self import --- .../networkx/algorithms/connectivity/edge_kcomponents.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi index 8eca2373a9dd..50d7dcc990e2 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete from collections.abc import Generator -from typing import Self +from typing_extensions import Self from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable