From 09aee4b0210418a51637607abe6f81b554ef25d8 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 7 Aug 2026 09:37:46 +0000 Subject: [PATCH] ruff C418, UP018 (unnecessary dict literal; `bool`, `int`, `str` call) --- pyproject.toml | 4 ---- test/objattrtest_d/common.py | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 769052e9..b2bf299f 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` - "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 "E701", # multiple statements per line @@ -75,9 +74,6 @@ ignore = [ "UP004", # Class `Binary` inherits from `object` "UP006", # Use `list` instead of `List` for type annotation "UP008", # Use `super()` instead of `super(__class__, self)` - "UP018", # Unnecessary `bool` call (rewrite as a literal) - "UP018", # Unnecessary `int` call (rewrite as a literal) - "UP018", # Unnecessary `str` call (rewrite as a literal) "UP022", # Prefer `capture_output` over sending `stdout` and `stderr` to `PIPE` "UP030", # Use implicit references for positional format fields "UP031", # Use format specifiers instead of percent format diff --git a/test/objattrtest_d/common.py b/test/objattrtest_d/common.py index 81ffda31..16551cf5 100755 --- a/test/objattrtest_d/common.py +++ b/test/objattrtest_d/common.py @@ -25,12 +25,12 @@ seed_bin = getrand(32) # use the constructors here! otherwise reassignment test might fail when # reassignment would otherwise succeed sample_objs = { - 'int': int(1), + 'int': 1, 'Decimal': Decimal('0.01'), 'NoneType': None, - 'bool': bool(True), - 'str': str('foo'), - 'dict': dict({'a': 1}), + 'bool': True, + 'str': 'foo', + 'dict': {'a': 1}, 'list': [1], 'tuple': (1, 2), 'bytes': bytes(1),