Skip to content

Commit

Permalink
style: Remove type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
plammens committed Jun 26, 2023
1 parent c809831 commit 9a8d8c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions networkx/algorithms/simple_paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import typing
from heapq import heappop, heappush
from itertools import count

Expand Down Expand Up @@ -345,7 +344,7 @@ def all_simple_edge_paths(G, source, target, cutoff=None):
yield from _all_simple_edge_paths(G, source, targets, cutoff)


def _all_simple_edge_paths(G: nx.Graph, source, targets: set, cutoff: int):
def _all_simple_edge_paths(G, source, targets, cutoff):
# We simulate recursion with a stack, keeping the current path being explored
# and the outgoing edge iterators at each point in the stack.
# To avoid unnecessary checks, the loop is structured in a way such that a path
Expand All @@ -362,8 +361,8 @@ def _all_simple_edge_paths(G: nx.Graph, source, targets: set, cutoff: int):
# The current_path is a dictionary that maps nodes in the path to the edge that was
# used to enter that node (instead of a list of edges) because we want both a fast
# membership test for nodes in the path and the preservation of insertion order.
current_path: dict = {None: None}
stack: list[typing.Iterator] = [iter([(None, source)])]
current_path = {None: None}
stack = [iter([(None, source)])]

while stack:
# 1. Try to extend the current path.
Expand Down

0 comments on commit 9a8d8c2

Please sign in to comment.