alpaca-trade-api-python
alpaca-trade-api-python copied to clipboard
Indentation of await self._consume() in stream.py
Question form pre-submit checklist.
- [X] I have searched the existing issues to ensure there isn't already an issue about this question.
- [X] My question has to do with the Python SDK and isn't a general question about the API. (If it is please open your issue here)
- [X] My question isn't about how to do a specific algorithm or asking for trade advice (answers to these are outside the scope of this repo).
Question
Hi,
This may or may not be a bug, I am only getting acquainted with asyncio. I notice an 'inconsistent' indentation in the file stream.py, and wanted to bring it up in case it is an error.
The command 'await self._consume()' is invoked twice, both times inside the definition of a _run_forever function. Both of these functions are pretty similar, as expected.
In line 254, 'await self._consume()' is outside an if statement and therefore always run in the while loop. In contrast, in line 713, 'await self._consume()' is inside an if statement, and therefore, I assume, not necessarily run.
thank you