diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index 69ae5198a..1b6496a64 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -57,7 +57,7 @@ class Binance(Exchange): (side == "buy" and stop_loss < float(order['info']['stopPrice'])) ) - def get_tickers(self, symbols: List[str] = None, cached: bool = False) -> Dict: + def get_tickers(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Dict: tickers = super().get_tickers(symbols=symbols, cached=cached) if self.trading_mode == TradingMode.FUTURES: # Binance's future result has no bid/ask values. @@ -95,7 +95,7 @@ class Binance(Exchange): async def _async_get_historic_ohlcv(self, pair: str, timeframe: str, since_ms: int, candle_type: CandleType, is_new_pair: bool = False, raise_: bool = False, - until_ms: int = None + until_ms: Optional[int] = None ) -> Tuple[str, str, str, List]: """ Overwrite to introduce "fast new pair" functionality by detecting the pair's listing date diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 6ef61f227..c1a9059a7 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1351,7 +1351,7 @@ class Exchange: raise OperationalException(e) from e @retrier - def fetch_bids_asks(self, symbols: List[str] = None, cached: bool = False) -> Dict: + def fetch_bids_asks(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Dict: """ :param cached: Allow cached result :return: fetch_tickers result @@ -1379,7 +1379,7 @@ class Exchange: raise OperationalException(e) from e @retrier - def get_tickers(self, symbols: List[str] = None, cached: bool = False) -> Dict: + def get_tickers(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Dict: """ :param cached: Allow cached result :return: fetch_tickers result diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index 900f6c898..0103e2702 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -45,7 +45,7 @@ class Kraken(Exchange): return (parent_check and market.get('darkpool', False) is False) - def get_tickers(self, symbols: List[str] = None, cached: bool = False) -> Dict: + def get_tickers(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Dict: # Only fetch tickers for current stake currency # Otherwise the request for kraken becomes too large. symbols = list(self.get_markets(quote_currencies=[self._config['stake_currency']])) diff --git a/freqtrade/persistence/trade_model.py b/freqtrade/persistence/trade_model.py index d2abb48d6..45a16bfbd 100644 --- a/freqtrade/persistence/trade_model.py +++ b/freqtrade/persistence/trade_model.py @@ -868,8 +868,8 @@ class LocalTrade(): return o return None - def select_order( - self, order_side: str = None, is_open: Optional[bool] = None) -> Optional[Order]: + def select_order(self, order_side: Optional[str] = None, + is_open: Optional[bool] = None) -> Optional[Order]: """ Finds latest order for this orderside and status :param order_side: ft_order_side of the order (either 'buy', 'sell' or 'stoploss') diff --git a/pyproject.toml b/pyproject.toml index 935874ab8..0cb81f745 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,3 +42,11 @@ ignore_errors = true [build-system] requires = ["setuptools >= 46.4.0", "wheel"] build-backend = "setuptools.build_meta" + +[tool.pyright] +include = ["freqtrade"] +exclude = [ + "**/__pycache__", + "build_helpers/*.py", +] +ignore = ["freqtrade/vendor/**"]