mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 04:25:50 +08:00
[networkx] Enhance annotation for Networkx.Graph.add_weighted_edges_from (#15528)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete, Unused
|
||||
from collections.abc import Generator, Iterable, Mapping, MutableSet, Reversible
|
||||
from decimal import Decimal
|
||||
from typing import NoReturn
|
||||
|
||||
from networkx.classes.digraph import DiGraph
|
||||
@@ -109,5 +110,5 @@ class PlanarEmbedding(DiGraph[_Node]):
|
||||
def add_edge(self, u_of_edge: _Node, v_of_edge: _Node, **attr: Unused) -> NoReturn: ...
|
||||
def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node]], **attr: Unused) -> NoReturn: ...
|
||||
def add_weighted_edges_from(
|
||||
self, ebunch_to_add: Iterable[tuple[_Node, _Node, float]], weight: str = "weight", **attr: Unused
|
||||
self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Unused
|
||||
) -> NoReturn: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from collections.abc import Callable, Collection, Hashable, Iterable, Iterator, MutableMapping
|
||||
from decimal import Decimal
|
||||
from functools import cached_property
|
||||
from typing import Any, ClassVar, TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
@@ -71,7 +72,7 @@ class Graph(Collection[_Node]):
|
||||
def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node]], **attr: Any) -> None: ...
|
||||
# attr: Edge data (or labels or objects) can be assigned using keyword arguments
|
||||
def add_weighted_edges_from(
|
||||
self, ebunch_to_add: Iterable[tuple[_Node, _Node, float]], weight: str = "weight", **attr: Any
|
||||
self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Any
|
||||
) -> None: ...
|
||||
# attr: Edge attributes to add/update for all edges.
|
||||
def remove_edge(self, u: _Node, v: _Node) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user