From f0c581d144794f49ae0ac0b2985bd68ad928d0df Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 17 Feb 2022 16:31:30 -0300 Subject: [PATCH] Fixed C405 Unnecessary list literal - rewrite as a set literal. --- kibot/kicad/sexpdata.py | 2 +- kibot/misc.py | 6 +++--- kibot/out_kicost.py | 2 +- kibot/out_qr_lib.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kibot/kicad/sexpdata.py b/kibot/kicad/sexpdata.py index 41e8be99..8e7b0bb6 100644 --- a/kibot/kicad/sexpdata.py +++ b/kibot/kicad/sexpdata.py @@ -581,7 +581,7 @@ class Parser(object): self.false = false self.string_to = (lambda x: x) if string_to is None else string_to self.line_comment = line_comment - self.atom_end = set([line_comment]) | self._atom_end_basic + self.atom_end = {line_comment} | self._atom_end_basic self.atom_end_or_escape_re = re.compile("{0}|{1}".format(self._atom_end_basic_or_escape_regexp, re.escape(line_comment))) diff --git a/kibot/misc.py b/kibot/misc.py index 1605f3ad..82155f71 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -135,9 +135,9 @@ DISTRIBUTORS = ['arrow', 'digikey', 'farnell', 'lcsc', 'mouser', 'newark', 'rs', DISTRIBUTORS_F = [d+'#' for d in DISTRIBUTORS] # ISO ISO4217 currency codes # Not all, but the ones we get from the European Central Bank (march 2021) -ISO_CURRENCIES = set(['EUR', 'USD', 'JPY', 'BGN', 'CZK', 'DKK', 'GBP', 'HUF', 'PLN', 'RON', 'SEK', 'CHF', 'ISK', 'NOK', 'HRK', - 'RUB', 'TRY', 'AUD', 'BRL', 'CAD', 'CNY', 'HKD', 'IDR', 'ILS', 'INR', 'KRW', 'MXN', 'MYR', 'NZD', 'PHP', - 'SGD', 'THB', 'ZAR']) +ISO_CURRENCIES = {'EUR', 'USD', 'JPY', 'BGN', 'CZK', 'DKK', 'GBP', 'HUF', 'PLN', 'RON', 'SEK', 'CHF', 'ISK', 'NOK', 'HRK', + 'RUB', 'TRY', 'AUD', 'BRL', 'CAD', 'CNY', 'HKD', 'IDR', 'ILS', 'INR', 'KRW', 'MXN', 'MYR', 'NZD', 'PHP', + 'SGD', 'THB', 'ZAR'} W_VARCFG = '(W001) ' W_VARPCB = '(W002) ' diff --git a/kibot/out_kicost.py b/kibot/out_kicost.py index f61f892e..6f357c19 100644 --- a/kibot/out_kicost.py +++ b/kibot/out_kicost.py @@ -142,7 +142,7 @@ class KiCostOptions(VariantOptions): super().run(name) net_dir = None if self._comps: - var_fields = set(['variant', 'version']) + var_fields = {'variant', 'version'} if self.variant and self.variant.type == 'kicost' and self.variant.variant_field not in var_fields: # Warning about KiCost limitations logger.warning(W_KICOSTFLD+'KiCost variant `{}` defines `variant_field` as `{}`, not supported by KiCost'. diff --git a/kibot/out_qr_lib.py b/kibot/out_qr_lib.py index 3961acab..0f5cd9b4 100644 --- a/kibot/out_qr_lib.py +++ b/kibot/out_qr_lib.py @@ -20,8 +20,8 @@ QR_ECCS = {'low': QrCode.Ecc.LOW, 'quartile': QrCode.Ecc.QUARTILE, 'high': QrCode.Ecc.HIGH} logger = log.get_logger() -TO_SEPARATE = set(['kicad_pcb', 'general', 'title_block', 'layers', 'setup', 'pcbplotparams', 'net_class', 'module', - 'kicad_sch', 'lib_symbols', 'symbol', 'sheet', 'sheet_instances', 'symbol_instances']) +TO_SEPARATE = {'kicad_pcb', 'general', 'title_block', 'layers', 'setup', 'pcbplotparams', 'net_class', 'module', + 'kicad_sch', 'lib_symbols', 'symbol', 'sheet', 'sheet_instances', 'symbol_instances'} def is_symbol(name, sexp):