Skip to content

Non-standard type-hinting thoughout the library. #208

@thisismygitrepo

Description

@thisismygitrepo

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    prioritizedThis issue is confirmed and we're working on it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions