avoid mutable default constructor values

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-20 11:59:04 -07:00
parent 462aecea3e
commit a09bd648af
51 changed files with 209 additions and 124 deletions

View File

@@ -437,10 +437,10 @@ class RTVIObserver(BaseObserver):
params (RTVIObserverParams): Settings to enable/disable specific messages.
"""
def __init__(self, rtvi: "RTVIProcessor", *, params: RTVIObserverParams = RTVIObserverParams()):
def __init__(self, rtvi: "RTVIProcessor", *, params: Optional[RTVIObserverParams] = None):
super().__init__()
self._rtvi = rtvi
self._params = params
self._params = params or RTVIObserverParams()
self._bot_transcription = ""
self._frames_seen = set()
rtvi.set_errors_enabled(self._params.errors_enabled)
@@ -632,12 +632,12 @@ class RTVIProcessor(FrameProcessor):
def __init__(
self,
*,
config: RTVIConfig = RTVIConfig(config=[]),
config: Optional[RTVIConfig] = None,
transport: Optional[BaseTransport] = None,
**kwargs,
):
super().__init__(**kwargs)
self._config = config
self._config = config or RTVIConfig(config=[])
self._bot_ready = False
self._client_ready = False