From 07eef183372e7dda39f7b427ff5cf22427a31bc8 Mon Sep 17 00:00:00 2001 From: shubhendra Date: Sat, 6 Mar 2021 13:01:01 +0530 Subject: [PATCH] Remove length check in favour of truthiness of the object Signed-off-by: shubhendra --- qlib/contrib/backtest/exchange.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/contrib/backtest/exchange.py b/qlib/contrib/backtest/exchange.py index 178950eeb..5a8b8b2b6 100644 --- a/qlib/contrib/backtest/exchange.py +++ b/qlib/contrib/backtest/exchange.py @@ -93,7 +93,7 @@ class Exchange: 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")