My linters and type checkers are failing to provide any help due to non-standard way of type hinting used in the library,
For instance, in the file: unified_trading:
def kline_stream(self, interval: int, symbol: (str, list), callback):
"""Subscribe to the klines stream."""
...
The proper way of enshrining the logic that symbol can be either str OR list[str] is:
from typing import Union, Callable
def kline_stream(self, interval: int, symbol: Union[str, list[str]], callaback: Callable[[str], None]):
...
Once fixed, type checker will be able to statically check all the code (including the library itself) for any inconsistency.
Can you guys please use the standards?
Thank you,
My linters and type checkers are failing to provide any help due to non-standard way of type hinting used in the library,
For instance, in the file:
unified_trading:The proper way of enshrining the logic that
symbolcan be eitherstrORlist[str]is:Once fixed, type checker will be able to statically check all the code (including the library itself) for any inconsistency.
Can you guys please use the standards?
Thank you,