chore: kwonly for cached arguments

This commit is contained in:
Matthias
2024-11-26 18:28:45 +01:00
parent 06bb43b13e
commit 183909f474
3 changed files with 5 additions and 5 deletions

View File

@@ -52,12 +52,12 @@ class Binance(Exchange):
(TradingMode.FUTURES, MarginMode.ISOLATED)
]
def get_tickers(self, symbols: list[str] | None = None, cached: bool = False) -> Tickers:
def get_tickers(self, symbols: list[str] | None = None, *, cached: bool = False) -> Tickers:
tickers = super().get_tickers(symbols=symbols, cached=cached)
if self.trading_mode == TradingMode.FUTURES:
# Binance's future result has no bid/ask values.
# Therefore we must fetch that from fetch_bids_asks and combine the two results.
bidsasks = self.fetch_bids_asks(symbols, cached)
bidsasks = self.fetch_bids_asks(symbols, cached=cached)
tickers = deep_merge_dicts(bidsasks, tickers, allow_null_overrides=False)
return tickers

View File

@@ -1768,7 +1768,7 @@ class Exchange:
raise OperationalException(e) from e
@retrier
def fetch_bids_asks(self, symbols: list[str] | None = None, cached: bool = False) -> dict:
def fetch_bids_asks(self, symbols: list[str] | None = None, *, cached: bool = False) -> dict:
"""
:param symbols: List of symbols to fetch
:param cached: Allow cached result
@@ -1801,7 +1801,7 @@ class Exchange:
raise OperationalException(e) from e
@retrier
def get_tickers(self, symbols: list[str] | None = None, cached: bool = False) -> Tickers:
def get_tickers(self, symbols: list[str] | None = None, *, cached: bool = False) -> Tickers:
"""
:param symbols: List of symbols to fetch
:param cached: Allow cached result

View File

@@ -50,7 +50,7 @@ class Kraken(Exchange):
return parent_check and market.get("darkpool", False) is False
def get_tickers(self, symbols: list[str] | None = None, cached: bool = False) -> Tickers:
def get_tickers(self, symbols: list[str] | None = None, *, cached: bool = False) -> Tickers:
# 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"]]))