runmode has type freqtrade.enums.runmode.RunMode but is used as type None

"filename": "freqtrade/configuration/configuration.py"
"warning_type": "Incompatible variable type [9]",
"warning_message": " runmode is declared to have type `freqtrade.enums.runmode.RunMode` but is used as type `None`.",
"warning_line": 31
"fix: Add Optional type
This commit is contained in:
Luca Di Grazia 2022-08-23 10:03:34 +02:00 committed by GitHub
parent a6d78a8615
commit 17e028cf68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ class Configuration:
Reuse this class for the bot, backtesting, hyperopt and every script that required configuration Reuse this class for the bot, backtesting, hyperopt and every script that required configuration
""" """
def __init__(self, args: Dict[str, Any], runmode: RunMode = None) -> None: def __init__(self, args: Dict[str, Any], runmode: Optional[RunMode] = None) -> None:
self.args = args self.args = args
self.config: Optional[Dict[str, Any]] = None self.config: Optional[Dict[str, Any]] = None
self.runmode = runmode self.runmode = runmode