Skip to content

Commit

Permalink
[PyCDE] Satisfy yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
teqdruid committed Feb 20, 2024
1 parent bc48316 commit e8f4f34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontends/PyCDE/src/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ def add_external_port_accessors(self):
"""For each port, replace it with a property to provide access to the
instances output in OTHER generators which are instantiating this module."""

def fgets_dict(s, outs):
return {n: g.fget(s) for n, g in outs.items()}

named_outputs = {}
for port in self.outputs:
assert port.name is not None
named_outputs[port.name] = port
setattr(self.modcls,
"outputs",
lambda self, outputs=named_outputs:
{n: g.fget(self) for n, g in outputs.items()})
lambda s, outs=named_outputs: fgets_dict(s, outs))

@property
def name(self):
Expand Down

0 comments on commit e8f4f34

Please sign in to comment.