mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Upgrade to Mypy 1.3.0 (old: 0.991). Fix compatibility problems with Mypy. Add type hints to bfxapi.websocket.handlers.
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
from typing import TypedDict, Union, Literal, Optional
|
||||
|
||||
_Channel = Literal[
|
||||
"ticker",
|
||||
"trades",
|
||||
"book",
|
||||
"candles",
|
||||
"status"
|
||||
]
|
||||
|
||||
_Header = TypedDict("_Header", {
|
||||
"event": Literal["subscribed"],
|
||||
"channel": _Channel,
|
||||
"chanId": int
|
||||
})
|
||||
|
||||
Subscription = Union[_Header, "Ticker", "Trades", "Book", "Candles", "Status"]
|
||||
from typing import TypedDict, \
|
||||
Union, Literal, Optional
|
||||
|
||||
class Ticker(TypedDict):
|
||||
subId: str
|
||||
@@ -43,3 +28,33 @@ class Candles(TypedDict):
|
||||
class Status(TypedDict):
|
||||
subId: str
|
||||
key: str
|
||||
|
||||
Subscription = Union["_Ticker", "_Trades", "_Book", "_Candles", "_Status"]
|
||||
|
||||
_Channel = Literal["ticker", "trades", "book", "candles", "status"]
|
||||
|
||||
_Header = TypedDict("_Header", {
|
||||
"event": Literal["subscribed"],
|
||||
"channel": _Channel,
|
||||
"chanId": int
|
||||
})
|
||||
|
||||
#pylint: disable-next=inherit-non-class
|
||||
class _Ticker(Ticker, _Header):
|
||||
pass
|
||||
|
||||
#pylint: disable-next=inherit-non-class
|
||||
class _Trades(Trades, _Header):
|
||||
pass
|
||||
|
||||
#pylint: disable-next=inherit-non-class
|
||||
class _Book(Book, _Header):
|
||||
pass
|
||||
|
||||
#pylint: disable-next=inherit-non-class
|
||||
class _Candles(Candles, _Header):
|
||||
pass
|
||||
|
||||
#pylint: disable-next=inherit-non-class
|
||||
class _Status(Status, _Header):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user