py3port: use set comprehensions where applicable
This commit is contained in:
parent
634fb2e444
commit
4b6772dc3b
4 changed files with 5 additions and 5 deletions
|
|
@ -283,7 +283,7 @@ class AddrIdxList(list,InitErrors,MMGenObject):
|
|||
self.arg_chk(type(self),on_fail)
|
||||
try:
|
||||
if idx_list:
|
||||
return list.__init__(self,sorted(set(AddrIdx(i,on_fail='raise') for i in idx_list)))
|
||||
return list.__init__(self,sorted({AddrIdx(i,on_fail='raise') for i in idx_list}))
|
||||
elif fmt_str:
|
||||
ret = []
|
||||
for i in (fmt_str.split(sep)):
|
||||
|
|
|
|||
|
|
@ -706,7 +706,7 @@ class MMGenToolCmdRPC(MMGenToolCmdBase):
|
|||
|
||||
if sort:
|
||||
sort = set(sort.split(','))
|
||||
sort_params = set(['reverse','age'])
|
||||
sort_params = {'reverse','age'}
|
||||
if not sort.issubset(sort_params):
|
||||
die(1,"The sort option takes the following parameters: '{}'".format("','".join(sort_params)))
|
||||
|
||||
|
|
|
|||
|
|
@ -669,7 +669,7 @@ Selected non-{pnm} inputs: {{}}""".strip().format(pnm=g.proj_name,pnl=g.proj_nam
|
|||
'Transaction file size exceeds limit ({} bytes)'.format(g.max_tx_file_size))
|
||||
|
||||
def get_non_mmaddrs(self,desc):
|
||||
return list(set(i.addr for i in getattr(self,desc) if not i.mmid))
|
||||
return {i.addr for i in getattr(self,desc) if not i.mmid}
|
||||
|
||||
def sign(self,tx_num_str,keys): # return True or False; don't exit or raise exception
|
||||
|
||||
|
|
@ -1329,7 +1329,7 @@ Selected non-{pnm} inputs: {{}}""".strip().format(pnm=g.proj_name,pnl=g.proj_nam
|
|||
non_mmaddrs = [i for i in sel_unspent if i.twmmid.type == 'non-mmgen']
|
||||
if non_mmaddrs and self.caller != 'txdo':
|
||||
msg(self.msg_non_mmgen_inputs.format(
|
||||
', '.join(set(sorted([a.addr.hl() for a in non_mmaddrs])))))
|
||||
', '.join(sorted({a.addr.hl() for a in non_mmaddrs}))))
|
||||
if not (opt.yes or keypress_confirm('Accept?')):
|
||||
continue
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ def get_seed_for_seed_id(sid,infiles,saved_seeds):
|
|||
|
||||
def generate_kals_for_mmgen_addrs(need_keys,infiles,saved_seeds):
|
||||
mmids = [e.mmid for e in need_keys]
|
||||
sids = set(i.sid for i in mmids)
|
||||
sids = {i.sid for i in mmids}
|
||||
vmsg('Need seed{}: {}'.format(suf(sids,'s'),' '.join(sids)))
|
||||
d = MMGenList()
|
||||
from mmgen.addr import KeyAddrList
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue