Further reduce problematic default args

This commit is contained in:
Matthias 2024-04-20 09:12:47 +02:00
parent 448b74840e
commit 8004829696
4 changed files with 7 additions and 5 deletions

View File

@ -237,8 +237,10 @@ class HyperoptTools:
result_dict.update(all_space_params)
@staticmethod
def _params_pretty_print(params, space: str, header: str, non_optimized={}) -> None:
if space in params or space in non_optimized:
def _params_pretty_print(
params, space: str, header: str, non_optimized: Optional[Dict] = None) -> None:
if space in params or (non_optimized and space in non_optimized):
space_params = HyperoptTools._space_params(params, space, 5)
no_params = HyperoptTools._space_params(non_optimized, space, 5)
appendix = ''

View File

@ -278,7 +278,7 @@ def text_table_add_metrics(strat_results: Dict) -> str:
def show_backtest_result(strategy: str, results: Dict[str, Any], stake_currency: str,
backtest_breakdown=[]):
backtest_breakdown: List[str]):
"""
Print results for one strategy
"""

View File

@ -152,7 +152,7 @@ class WebSocketChannel:
"""
return self._closed.is_set()
def set_subscriptions(self, subscriptions: List[str] = []) -> None:
def set_subscriptions(self, subscriptions: List[str]) -> None:
"""
Set which subscriptions this channel is subscribed to

View File

@ -155,7 +155,7 @@ class RPC:
}
return val
def _rpc_trade_status(self, trade_ids: List[int] = []) -> List[Dict[str, Any]]:
def _rpc_trade_status(self, trade_ids: Optional[List[int]] = None) -> List[Dict[str, Any]]:
"""
Below follows the RPC backend it is prefixed with rpc_ to raise awareness that it is
a remotely exposed function