Remove length check in favour of truthiness of the object

Signed-off-by: shubhendra <withshubh@gmail.com>
This commit is contained in:
shubhendra 2021-03-21 17:14:32 +05:30
parent 537ad059bc
commit 6d6ad035d6
No known key found for this signature in database
GPG Key ID: 9AFEF5C98D542137
2 changed files with 3 additions and 3 deletions

View File

@ -177,7 +177,7 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
# human-readable formats. # human-readable formats.
print() print()
if len(pairs): if pairs:
if args.get('print_list', False): if args.get('print_list', False):
# print data as a list, with human-readable summary # print data as a list, with human-readable summary
print(f"{summary_str}: {', '.join(pairs.keys())}.") print(f"{summary_str}: {', '.join(pairs.keys())}.")

View File

@ -958,7 +958,7 @@ class Exchange:
while True: while True:
t = await self._async_fetch_trades(pair, t = await self._async_fetch_trades(pair,
params={self._trades_pagination_arg: from_id}) params={self._trades_pagination_arg: from_id})
if len(t): if t:
# Skip last id since its the key for the next call # Skip last id since its the key for the next call
trades.extend(t[:-1]) trades.extend(t[:-1])
if from_id == t[-1][1] or t[-1][0] > until: if from_id == t[-1][1] or t[-1][0] > until:
@ -990,7 +990,7 @@ class Exchange:
# DEFAULT_TRADES_COLUMNS: 1 -> id # DEFAULT_TRADES_COLUMNS: 1 -> id
while True: while True:
t = await self._async_fetch_trades(pair, since=since) t = await self._async_fetch_trades(pair, since=since)
if len(t): if t:
since = t[-1][0] since = t[-1][0]
trades.extend(t) trades.extend(t)
# Reached the end of the defined-download period # Reached the end of the defined-download period