Revert "Flatten the output of RecordObject.ports()"
authorMichael Nolan <mtnolan2640@gmail.com>
Tue, 5 May 2020 13:09:49 +0000 (09:09 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Tue, 5 May 2020 13:09:49 +0000 (09:09 -0400)
This reverts commit c2da46e377fbf04488622dbf33aa240988b1dd9e.

src/nmutil/iocontrol.py

index e403da7112cf575b0b74288307ae7b628f8f54f9..853a1d040d9f6dcdfd48daee06674f94953b2f58 100644 (file)
@@ -103,15 +103,7 @@ class RecordObject(Record):
                 yield x
 
     def ports(self): # would be better being called "keys"
-        results = []
-        # If the record itself contains records, flatten them
-        for item in list(self):
-            ports_fun = getattr(item, "ports", None)
-            if callable(ports_fun):
-                results.extend(ports_fun())
-            else:
-                results.append(item)
-        return results
+        return list(self)
 
 
 class PrevControl(Elaboratable):