It looks like you're new here. If you want to get involved, click one of these buttons!
def _on_error(self, ws, code, reason):
if self.on_error:
self.on_error(self, code, reason) # <--- Here, shouldn't self be replaced with ws
self.ws = self.factory.ws
which is an alias for the actual websocket in the KiteTicker class?Am i correct?
You can use the above functions in Python, my code uses them daily and its working perfectly fine. (In the on_close function use 'raise SystemExit' only if you want to exit your code.)
My query was to understand the code, rather than just being able to use it.
But once again thanks for your time
The base API is coded in a lower level language, and 'self' is a part of the wrapping process. You can go through the repositories for KiteConnect and KiteTicker classes (link shared below) and you will observe that 'self' method is present in each API call function.
https://github.com/zerodha/pykiteconnect/blob/master/kiteconnect/connect.py
https://github.com/zerodha/pykiteconnect/blob/master/kiteconnect/ticker.py