Skip to content

Commit

Permalink
fix: Add typehints to _WeightFunction type alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sunglasses committed Sep 17, 2024
1 parent e9a28c5 commit 18dde72
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from _typeshed import Incomplete
from collections.abc import Callable, Generator
from typing import Any
from typing_extensions import TypeAlias

from networkx.utils.backends import _dispatch

# type alias for the weight function
_WeightFunction = Callable[[Any, Any, dict[str, Any]], float | None]
_WeightFunction: TypeAlias = Callable[[Any, Any, dict[str, Any]], float | None]

@_dispatch
def dijkstra_path(G, source, target, weight: str | _WeightFunction = "weight"): ...
Expand Down

0 comments on commit 18dde72

Please sign in to comment.