Fixed C405 Unnecessary list literal - rewrite as a set literal.
This commit is contained in:
parent
c11627f56d
commit
f0c581d144
|
|
@ -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)))
|
||||
|
||||
|
|
|
|||
|
|
@ -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) '
|
||||
|
|
|
|||
|
|
@ -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'.
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue