From 593ad0c4af1f7b3176c25ea3dffe4510712d1133 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 28 Apr 2019 12:23:58 +0100 Subject: [PATCH] add comments to iocontrol.py g --- src/add/iocontrol.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) -- 2.30.2