From a3ba236e3687b41eb69698d026f11913f5c1d4d3 Mon Sep 17 00:00:00 2001 From: Mark Koch Date: Fri, 24 Nov 2023 15:13:39 +0000 Subject: [PATCH] Fix add_input_with_ports --- guppy/hugr/hugr.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/guppy/hugr/hugr.py b/guppy/hugr/hugr.py index 35880c29..59a00e97 100644 --- a/guppy/hugr/hugr.py +++ b/guppy/hugr/hugr.py @@ -3,7 +3,7 @@ from abc import ABC, abstractmethod from contextlib import contextmanager -from typing import Optional, Iterator, Tuple, Any +from typing import Optional, Iterator, Tuple, Any, Sequence from dataclasses import field, dataclass import guppy.hugr.ops as ops @@ -376,11 +376,12 @@ def add_input( return node def add_input_with_ports( - self, output_tys: TypeList, parent: Optional[Node] = None + self, output_tys: Sequence[GuppyType], parent: Optional[Node] = None ) -> tuple[VNode, list[OutPortV]]: """Adds an `Input` node to the graph.""" - node = self.add_input(output_tys, parent) - return node, [node.add_out_port(ty) for ty in output_tys] + node = self.add_input(list(output_tys), parent) + ports = [node.add_out_port(ty) for ty in output_tys] + return node, ports def add_output( self,