From 0f3b5e9edf70c92634943b969bc32c043f1f84dc Mon Sep 17 00:00:00 2001 From: KV Date: Sat, 14 Nov 2020 20:19:31 +0100 Subject: [PATCH] Skip assignment and return expression directly --- src/wireviz/wv_bom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wireviz/wv_bom.py b/src/wireviz/wv_bom.py index ac5b071..3176c2d 100644 --- a/src/wireviz/wv_bom.py +++ b/src/wireviz/wv_bom.py @@ -115,8 +115,7 @@ def generate_bom(harness): bom = sorted(bom, key=lambda k: k['item']) # sort list of dicts by their values (https://stackoverflow.com/a/73050) # add an incrementing id to each bom item - bom = [{**entry, 'id': index} for index, entry in enumerate(bom, 1)] - return bom + return [{**entry, 'id': index} for index, entry in enumerate(bom, 1)] def get_bom_index(harness, item, unit, manufacturer, mpn, pn): # Remove linebreaks and clean whitespace of values in search