Repository: microsoft/qlib

Issue:
[Refactor] Non mutable default argument.
## 🐛 Bug Description

<!-- A clear and concise description of what the bug is. -->
It is not a good way to use dict as default argument.
## To Reproduce

Steps to reproduce the behavior:

1.
1.
1.


## Expected Behavior

<!-- A clear and concise description of what you expected to happen. -->

## Screenshot

<!-- A screenshot of the error message or anything shouldn't appear-->

## Environment

**Note**: User could run `cd scripts && python collect_info.py all` under project directory to get system information
and paste them here directly.

 - Qlib version:
 - Python version:
 - OS (`Windows`, `Linux`, `MacOS`):
 - Commit number (optional, please provide it if you are using the dev version):

## Additional Notes

<!-- Add any other information about the problem here. -->



Discussion:

Resolving patch:
diff --git a/qlib/workflow/record_temp.py b/qlib/workflow/record_temp.py
--- a/qlib/workflow/record_temp.py
+++ b/qlib/workflow/record_temp.py
@@ -359,26 +359,7 @@ class PortAnaRecord(ACRecordTemp):
     def __init__(
         self,
         recorder,
-        config: dict = {  # Default config for daily trading
-            "strategy": {
-                "class": "TopkDropoutStrategy",
-                "module_path": "qlib.contrib.strategy",
-                "kwargs": {"signal": "<PRED>", "topk": 50, "n_drop": 5},
-            },
-            "backtest": {
-                "start_time": None,
-                "end_time": None,
-                "account": 100000000,
-                "benchmark": "SH000300",
-                "exchange_kwargs": {
-                    "limit_threshold": 0.095,
-                    "deal_price": "close",
-                    "open_cost": 0.0005,
-                    "close_cost": 0.0015,
-                    "min_cost": 5,
-                },
-            },
-        },
+        config=None,
         risk_analysis_freq: Union[List, str] = None,
         indicator_analysis_freq: Union[List, str] = None,
         indicator_analysis_method=None,
@@ -401,6 +382,27 @@ def __init__(
         """
         super().__init__(recorder=recorder, skip_existing=skip_existing, **kwargs)
 
+        if config is None:
+            config = {  # Default config for daily trading
+                "strategy": {
+                    "class": "TopkDropoutStrategy",
+                    "module_path": "qlib.contrib.strategy",
+                    "kwargs": {"signal": "<PRED>", "topk": 50, "n_drop": 5},
+                },
+                "backtest": {
+                    "start_time": None,
+                    "end_time": None,
+                    "account": 100000000,
+                    "benchmark": "SH000300",
+                    "exchange_kwargs": {
+                        "limit_threshold": 0.095,
+                        "deal_price": "close",
+                        "open_cost": 0.0005,
+                        "close_cost": 0.0015,
+                        "min_cost": 5,
+                    },
+                },
+            }
         # We only deepcopy_basic_type because
         # - We don't want to affect the config outside.
         # - We don't want to deepcopy complex object to avoid overhead


Test patch: