From 720feb60f67dbd2cc1bab4c130c206d605dbf7c4 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 7 Aug 2026 09:37:46 +0000 Subject: [PATCH] ruff C414 (unnecessary `list()` call within `set()`) --- mmgen/baseconv.py | 4 ++-- mmgen/obj.py | 2 +- pyproject.toml | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mmgen/baseconv.py b/mmgen/baseconv.py index 5935f046..d5cb0676 100755 --- a/mmgen/baseconv.py +++ b/mmgen/baseconv.py @@ -25,10 +25,10 @@ from collections import namedtuple from .util import die def is_b58_str(s): - return set(list(s)) <= set(baseconv('b58').digits) + return set(s) <= set(baseconv('b58').digits) def is_b32_str(s): - return set(list(s)) <= set(baseconv('b32').digits) + return set(s) <= set(baseconv('b32').digits) def is_mmgen_mnemonic(s): try: diff --git a/mmgen/obj.py b/mmgen/obj.py index be4bbb68..49c09d85 100755 --- a/mmgen/obj.py +++ b/mmgen/obj.py @@ -381,7 +381,7 @@ class MMGenLabel(HiliteStr, InitErrors): if cls.first_char and s and not s[0] in cls.first_char: raise ValueError('first character not in set ' + ' '.join(cls.first_char)) - if cls.allowed and not set(list(s)).issubset(set(cls.allowed)): + if cls.allowed and not set(s).issubset(set(cls.allowed)): raise ValueError('contains symbols not in set: ' + ' '.join(cls.allowed)) if cls.forbidden and any(ch in s for ch in cls.forbidden): diff --git a/pyproject.toml b/pyproject.toml index dea89f22..769052e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,6 @@ ignore = [ "B018", # Found useless expression. Either assign it to a variable or remove it. "B026", # Star-arg unpacking after a keyword argument is strongly discouraged "BLE001", # Do not catch blind exception: `Exception` - "C414", # Unnecessary `list()` call within `set()` "C418", # Unnecessary dict literal passed to `dict()` (remove the outer call to `dict()`) "E401", # multiple imports per line "E402", # module import not top of file