Skip to content
Prev Previous commit
Next Next commit
Remove length check in favour of truthiness of the object
Signed-off-by: shubhendra <withshubh@gmail.com>
  • Loading branch information
withshubh committed Mar 6, 2021
commit 07eef183372e7dda39f7b427ff5cf22427a31bc8
2 changes: 1 addition & 1 deletion qlib/contrib/backtest/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(
self.limit_threshold = limit_threshold
# TODO: the quote, trade_dates, codes are not necessray.
# It is just for performance consideration.
if trade_dates is not None and len(trade_dates):
if trade_dates is not None and trade_dates:
start_date, end_date = trade_dates[0], trade_dates[-1]
else:
self.logger.warning("trade_dates have not been assigned, all dates will be loaded")
Expand Down