Skip to content

Commit

Permalink
Workaround typing.Deque for pypy
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 28, 2019
1 parent 9a3f8e7 commit c5788de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions chess/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import chess

from types import TracebackType
from typing import Any, Callable, Coroutine, Deque, Dict, Generator, Generic, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Text, Tuple, Type, TypeVar, Union
from typing import Any, Callable, Coroutine, Dict, Generator, Generic, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Text, Tuple, Type, TypeVar, Union


LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -537,7 +537,7 @@ def __str__(self) -> str:
class MockTransport:
def __init__(self, protocol: "EngineProtocol") -> None:
self.protocol = protocol
self.expectations = collections.deque() # type: Deque[Tuple[str, List[str]]]
self.expectations = collections.deque() # type: typing.Deque[Tuple[str, List[str]]]
self.expected_pings = 0
self.stdin_buffer = bytearray()
self.protocol.connection_made(self)
Expand Down
5 changes: 3 additions & 2 deletions chess/syzygy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
import re
import struct
import threading
import typing

import chess

from types import TracebackType
from typing import Deque, Dict, Iterator, List, Mapping, MutableMapping, Optional, Tuple, Type
from typing import Dict, Iterator, List, Mapping, MutableMapping, Optional, Tuple, Type


UINT64_BE = struct.Struct(">Q")
Expand Down Expand Up @@ -1469,7 +1470,7 @@ def __init__(self, *, max_fds: Optional[int] = 128, VariantBoard: Type[chess.Boa
self.variant = VariantBoard

self.max_fds = max_fds
self.lru = collections.deque() # type: Deque[Table]
self.lru = collections.deque() # type: typing.Deque[Table]
self.lru_lock = threading.Lock()

self.wdl = {} # type: MutableMapping[str, WdlTable]
Expand Down

0 comments on commit c5788de

Please sign in to comment.