I find it hard to understand this as a list or ports or a list of booleans. I think the former is intended. Do you think you can rewrite this in the form of [port for port in egr_ports if (condition)] ?