From a4f07953a888b826223bf439fda6319b2758ba5c Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Wed, 1 Aug 2018 11:06:53 +0100 Subject: [PATCH] Complain if an elipsis is in the chain --- bonobo/structs/graphs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bonobo/structs/graphs.py b/bonobo/structs/graphs.py index 430127b..222ef69 100644 --- a/bonobo/structs/graphs.py +++ b/bonobo/structs/graphs.py @@ -29,12 +29,13 @@ class GraphCursor: def __rshift__(self, other): """ Self >> Other """ - if other == ...: + nodes = other.nodes if hasattr(other, "nodes") else [other] + + if ... in nodes: raise NotImplementedError( "Expected something looking like a node, but got an Ellipsis (...). Did you forget to complete the graph?" ) - nodes = other.nodes if hasattr(other, "nodes") else [other] if len(nodes): chain = self.graph.add_chain(*nodes, _input=self.last)