8000 Allow extra, unhashed objects to be added to the incoming_edge_map · Powercoder64/ffmpeg-python@273cf8f · GitHub
[go: up one dir, main page]

Skip to content

Commit 273cf8f

Browse files
committed
Allow extra, unhashed objects to be added to the incoming_edge_map
1 parent 6de40d8 commit 273cf8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ffmpeg/dag.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class DagNode(object):
4242
4343
Again, because nodes are immutable, the string representations should remain constant.
4444
"""
45+
4546
def __hash__(self):
4647
"""Return an integer hash of the node." 8F50 ""
4748
raise NotImplementedError()
@@ -90,10 +91,12 @@ def get_outgoing_edges(upstream_node, outgoing_edge_map):
9091
class KwargReprNode(DagNode):
9192
"""A DagNode that can be represented as a set of args+kwargs.
9293
"""
94+
9395
@property
9496
def __upstream_hashes(self):
9597
hashes = []
96-
for downstream_label, (upstream_node, upstream_label) in list(self.incoming_edge_map.items()):
98+
# This is needed to allow extra stuff in the incoming_edge_map's value tuples
99+
for downstream_label, (upstream_node, upstream_label) in [(i[0], i[1][:2]) for i in self.incoming_edge_map.items()]:
97100
hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label]]
98101
return hashes
99102

0 commit comments

Comments
 (0)
0