diff options
author | Jonathan Ellis <jbellis@gmail.com> | 2007-08-03 04:49:34 +0000 |
---|---|---|
committer | Jonathan Ellis <jbellis@gmail.com> | 2007-08-03 04:49:34 +0000 |
commit | 42812c06c182b236f491cb33315527a54fcba002 (patch) | |
tree | d4c65a5d4e8b403a249e71f863e5486ee299b7b9 | |
parent | f4b524f9b3455a75466fb4658c6bdd1eab96fa7c (diff) | |
download | sqlalchemy-42812c06c182b236f491cb33315527a54fcba002.tar.gz |
add comment, intermediate var for readability
-rw-r--r-- | lib/sqlalchemy/topological.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/topological.py b/lib/sqlalchemy/topological.py index 56c8cb46e..dcfe9ea71 100644 --- a/lib/sqlalchemy/topological.py +++ b/lib/sqlalchemy/topological.py @@ -307,9 +307,9 @@ class QueueDependencySorter(object): for parent in edges.get_parents(): traverse(parent) - for cycle in dict([(id(s), s) for s in cycles.values()]).values(): - edgecollection = [] - for edge in edges: - if edge[0] in cycle and edge[1] in cycle: - edgecollection.append(edge) + # sets are not hashable, so uniquify with id + unique_cycles = dict([(id(s), s) for s in cycles.values()]).values() + for cycle in unique_cycles: + edgecollection = [edge for edge in edges + if edge[0] in cycle and edge[1] in cycle] yield edgecollection |