From f157b0c8414ccd4c3a44bba720a107311481fbbf Mon Sep 17 00:00:00 2001 From: mohamedemad4 Date: Tue, 6 Oct 2020 04:26:36 +0200 Subject: [PATCH] removed config as a default arg;added comment to explain why on_error() and on_close() don't get a self --- tiingo/wsclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiingo/wsclient.py b/tiingo/wsclient.py index 01f8928..5747e36 100644 --- a/tiingo/wsclient.py +++ b/tiingo/wsclient.py @@ -38,7 +38,7 @@ class TiingoWebsocketClient: while True:pass ''' - def __init__(self,config={},endpoint=None,on_msg_cb=None): + def __init__(self,config,endpoint=None,on_msg_cb=None): self._base_url = "wss://api.tiingo.com" self.config=config @@ -88,6 +88,7 @@ class TiingoWebsocketClient: return return on_msg_cb_local + # since methods need to be unbound in order for websocketClient these methods don't have a self as their first parameter def on_error(ws, error): print(error)