From: Luke Kenneth Casson Leighton Date: Sun, 28 Apr 2019 11:23:58 +0000 (+0100) Subject: add comments to iocontrol.py X-Git-Tag: ls180-24jan2020~1163 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=593ad0c4af1f7b3176c25ea3dffe4510712d1133;p=ieee754fpu.git add comments to iocontrol.py g --- diff --git a/src/add/iocontrol.py b/src/add/iocontrol.py index 2e18312a..0554b71d 100644 --- a/src/add/iocontrol.py +++ b/src/add/iocontrol.py @@ -105,7 +105,7 @@ class Object: raise AttributeError(e) def __iter__(self): - for x in self.fields.values(): + for x in self.fields.values(): # OrderedDict so order is preserved if isinstance(x, Iterable): yield from x else: @@ -124,7 +124,7 @@ class Object: print (res) return res - def ports(self): + def ports(self): # being called "keys" would be much better return list(self) @@ -148,13 +148,13 @@ class RecordObject(Record): self.layout.fields.update(newlayout) def __iter__(self): - for x in self.fields.values(): + for x in self.fields.values(): # remember: fields is an OrderedDict if isinstance(x, Iterable): - yield from x + yield from x # a bit like flatten (nmigen.tools) else: yield x - def ports(self): + def ports(self): # would be better being called "keys" return list(self)