def add_edge_by_indices(self, u: int, v: int, weight: float) -> None: edge: WeightedEdge = WeightedEdge(u, v, weight) self.add_edge(edge) # 親クラスのメソッドを呼ぶ。
def add_edge_by_indices(self, u: int, v: int, weight: float) -> None: edge: WeightedEdge = WeightedEdge(u, v, weight) self.add_edge(edge) # スーパークラス呼び出し
def add_edge_by_indices(self, _from: int, _to: int, weight: float) -> None: edge: WeightedEdge = WeightedEdge(_from, _to, weight) self.add_edge(edge)
def add_edge_by_indices(self, u, v, weight): edge = WeightedEdge(u, v, weight) self.add_edge(edge)
def add_edge_by_indices(self, u: int, v: int, weight: float = 0) -> None: edge: WeightedEdge = WeightedEdge(u, v, weight) self.add_edge(edge) # call superclass version
def add_edge_by_indices(self, u: int, v: int, weight: int) -> None: edge: WeightedEdge = WeightedEdge(u,v,weight) # 调用超类的方法 self.add_edge(edge)
def add_edge_by_indices(self, u: int, v: int, weight: float) -> None: edge: WeightedEdge = WeightedEdge(u, v, weight) self.add_edge(edge) # вызываем версию суперкласса