Skip to content

Commit

Permalink
fix annotation compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel1rf committed Oct 29, 2021
1 parent 5a42a39 commit 43220f6
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pybotters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
from typing import Any, Mapping, Optional, Tuple, Union

Expand Down
2 changes: 2 additions & 0 deletions pybotters/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import base64
import hashlib
import hmac
Expand Down
2 changes: 2 additions & 0 deletions pybotters/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import json
import logging
Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/binance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
from collections import deque
from typing import Any, Awaitable, Optional, Union
Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/bitbank.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json
from typing import Optional

Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/bybit.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import logging
from typing import Any, Awaitable, Optional, Union
Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/experimental.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import logging
from typing import Awaitable, Optional, Union
Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/ftx.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import logging
from typing import Any, Awaitable, Optional
Expand Down
2 changes: 2 additions & 0 deletions pybotters/models/gmocoin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import logging
from datetime import datetime, timezone
Expand Down
2 changes: 2 additions & 0 deletions pybotters/store.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import uuid
from typing import Any, Hashable, Iterator, Optional, Type, TypeVar, cast
Expand Down
4 changes: 2 additions & 2 deletions pybotters/typedefs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Coroutine, Optional
from typing import Any, Callable, Coroutine, Dict, Optional

from aiohttp.client_ws import ClientWebSocketResponse

Expand All @@ -8,4 +8,4 @@
WsJsonHandler = Callable[
[Any, ClientWebSocketResponse], Optional[Coroutine[Any, Any, None]]
]
Item = dict[str, Any]
Item = Dict[str, Any]
6 changes: 5 additions & 1 deletion pybotters/ws.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import base64
import datetime
Expand Down Expand Up @@ -29,9 +31,11 @@ async def ws_run_forever(
send_json: Any = None,
hdlr_str=None,
hdlr_json=None,
auth=_Auth,
auth: Optional[_Auth] = None,
**kwargs: Any,
) -> None:
if auth is None:
auth = _Auth()
if all([hdlr_str is None, hdlr_json is None]):
hdlr_json = pybotters.print_handler
iscorofunc_str = asyncio.iscoroutinefunction(hdlr_str)
Expand Down

0 comments on commit 43220f6

Please sign in to comment.