Skip to content

Commit

Permalink
Fix add_input_with_ports
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Nov 24, 2023
1 parent 497cd23 commit a3ba236
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions guppy/hugr/hugr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a3ba236

Please sign in to comment.