Skip to content

Commit

Permalink
gravel: ignore type because mypy is annoying
Browse files Browse the repository at this point in the history
We're not ignoring it just because we don't like it, but because mypy is
having a hard time dealing with a callback's type.

  See python/mypy#5485

Signed-off-by: Joao Eduardo Luis <[email protected]>
  • Loading branch information
jecluis authored and votdev committed Mar 10, 2021
1 parent aaca218 commit fbe98ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gravel/controllers/resources/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def subscribe(
async def _publish(self) -> None:
assert self._latest
for subscriber in self._subscribers:
await subscriber.cb(self._latest)
# ignore type because mypy is somehow broken when doing callbacks
# see https://github.com/python/mypy/issues/5485
await subscriber.cb(self._latest) # type: ignore
if subscriber.once:
self._subscribers.remove(subscriber)

Expand Down

0 comments on commit fbe98ae

Please sign in to comment.