Skip to content

Commit

Permalink
upgrade to mypy v0.982 (#7241)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored Nov 2, 2022
1 parent c137ac0 commit f913f8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
# dependency. Make sure to update flake8-bugbear manually on a regular basis.
- flake8-bugbear==22.9.23
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.982
hooks:
- id: mypy
# Override default --ignore-missing-imports
Expand Down Expand Up @@ -66,7 +66,7 @@ repos:
# Note that we are not checking MacOSX explicitly, as there are typically no
# differences from Linux.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.982
hooks:
- id: mypy
args: [--warn-unused-configs, --platform, win32]
Expand Down
7 changes: 3 additions & 4 deletions distributed/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ class HeapSet(MutableSet[T]):
_sorted: bool

def __init__(self, *, key: Callable[[T], Any]):
# FIXME https://github.com/python/mypy/issues/708
self.key = key # type: ignore
self.key = key
self._data = set()
self._inc = 0
self._heap = []
Expand All @@ -78,7 +77,7 @@ def _unpickle(
key: Callable[[T], Any], inc: int, heap: list[tuple[Any, int, T]]
) -> HeapSet[T]:
self = object.__new__(HeapSet)
self.key = key # type: ignore
self.key = key
self._data = {v for _, _, v in heap}
self._inc = inc
self._heap = [(k, i, weakref.ref(v)) for k, i, v in heap]
Expand All @@ -95,7 +94,7 @@ def __len__(self) -> int:
def add(self, value: T) -> None:
if value in self._data:
return
k = self.key(value) # type: ignore
k = self.key(value)
vref = weakref.ref(value)
heapq.heappush(self._heap, (k, self._inc, vref))
self._sorted = False
Expand Down

0 comments on commit f913f8e

Please sign in to comment.