Skip to content

Commit

Permalink
Restrict the type using assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopo committed May 27, 2024
1 parent c2f995f commit c34ab38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgrestq/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ def __iter__(
while True:
task, id_, queue_name = self.get()
if id_ is not None:
# they are always None together, restrict the type
assert task is not None
assert queue_name is not None
yield task, id_, queue_name
self.complete(id_)
if self.is_empty():
Expand Down

0 comments on commit c34ab38

Please sign in to comment.