From 881c6fea0391fd9e130b81859f3d341b30abed2d Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 11 Oct 2023 12:58:49 +0000 Subject: [PATCH] pylint throughout (excluding tests) - inherit from object implicitly --- mmgen/altcoin.py | 2 +- mmgen/baseconv.py | 2 +- mmgen/contrib/keccak.py | 6 +++--- mmgen/mn_entry.py | 4 ++-- mmgen/proto/btc/tx/status.py | 2 +- mmgen/seedsplit.py | 2 +- mmgen/sha2.py | 2 +- mmgen/term.py | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mmgen/altcoin.py b/mmgen/altcoin.py index bbf309e9..58913030 100755 --- a/mmgen/altcoin.py +++ b/mmgen/altcoin.py @@ -55,7 +55,7 @@ def test_equal(desc,a,b,*cdata): ce = namedtuple('CoinInfoEntry', ['name','symbol','wif_ver_num','p2pkh_info','p2sh_info','has_segwit','trust_level']) -class CoinInfo(object): +class CoinInfo: coin_constants = {} coin_constants['mainnet'] = ( # Trust levels: -1=disabled 0=untested 1=low 2=med 3=high 4=very high (no warn) 5=unconditional diff --git a/mmgen/baseconv.py b/mmgen/baseconv.py index e87e6a35..3bf569d0 100755 --- a/mmgen/baseconv.py +++ b/mmgen/baseconv.py @@ -37,7 +37,7 @@ def is_mmgen_mnemonic(s): except: return False -class baseconv(object): +class baseconv: mn_base = 1626 dt = namedtuple('desc_tuple',['short','long']) constants = { diff --git a/mmgen/contrib/keccak.py b/mmgen/contrib/keccak.py index fc866dc1..5cba4b5b 100755 --- a/mmgen/contrib/keccak.py +++ b/mmgen/contrib/keccak.py @@ -104,7 +104,7 @@ def keccak_f(state): for ir in range(nr): round(state.s, RoundConstants[ir]) -class KeccakState(object): +class KeccakState: """ A keccak state container. @@ -216,7 +216,7 @@ class KeccakState(object): self.s[x][y] = KeccakState.bytes2lane(bb[i:i+8]) i += 8 -class KeccakSponge(object): +class KeccakSponge: def __init__(self, bitrate, width, padfn, permfn): self.state = KeccakState(bitrate, width) self.padfn = padfn @@ -254,7 +254,7 @@ class KeccakSponge(object): Z += self.squeeze_once() return Z[:l] -class KeccakHash(object): +class KeccakHash: """ The Keccak hash function, with a hashlib-compatible interface. """ diff --git a/mmgen/mn_entry.py b/mmgen/mn_entry.py index 258fae5e..93db9c38 100755 --- a/mmgen/mn_entry.py +++ b/mmgen/mn_entry.py @@ -29,7 +29,7 @@ from .color import cyan _return_chars = '\n\r ' _erase_chars = '\b\x7f' -class MnEntryMode(object): +class MnEntryMode: """ Subclasses must implement: - pad_max: pad character limit (None if variable) @@ -212,7 +212,7 @@ class MnEntryModeMinimal(MnEntryMode): if pad > self.pad_max: return mne.idx(s,'full',lo_idx=lo,hi_idx=hi) -class MnemonicEntry(object): +class MnemonicEntry: prompt_info = { 'intro': """ diff --git a/mmgen/proto/btc/tx/status.py b/mmgen/proto/btc/tx/status.py index 0f8e4504..4c9a5c31 100755 --- a/mmgen/proto/btc/tx/status.py +++ b/mmgen/proto/btc/tx/status.py @@ -23,7 +23,7 @@ class Status(TxBase.Status): tx = self.tx - class r(object): + class r: pass async def is_in_wallet(): diff --git a/mmgen/seedsplit.py b/mmgen/seedsplit.py index a81d7686..c1629937 100755 --- a/mmgen/seedsplit.py +++ b/mmgen/seedsplit.py @@ -305,7 +305,7 @@ def join_shares( if not hasattr(seed_list,'__next__'): # seed_list can be iterator or iterable seed_list = iter(seed_list) - class d(object): + class d: byte_len,ret,count = None,0,0 def add_share(ss): diff --git a/mmgen/sha2.py b/mmgen/sha2.py index 159834d9..959d78d2 100755 --- a/mmgen/sha2.py +++ b/mmgen/sha2.py @@ -29,7 +29,7 @@ sha2: A non-optimized but very compact implementation of the SHA2 hash from struct import pack,unpack -class Sha2(object): +class Sha2: 'Implementation based on the pseudocode at https://en.wikipedia.org/wiki/SHA-2' K = None diff --git a/mmgen/term.py b/mmgen/term.py index a2b3fbf8..cb082e88 100755 --- a/mmgen/term.py +++ b/mmgen/term.py @@ -42,7 +42,7 @@ except: _term_dimensions = namedtuple('terminal_dimensions',['width','height']) -class MMGenTerm(object): +class MMGenTerm: @classmethod def register_cleanup(cls):