Skip to content

Commit c34ab38

Browse files
author
jacopo
committed
Restrict the type using assertions
1 parent c2f995f commit c34ab38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

postgrestq/task_queue.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ def __iter__(
691691
while True:
692692
task, id_, queue_name = self.get()
693693
if id_ is not None:
694+
# they are always None together, restrict the type
695+
assert task is not None
696+
assert queue_name is not None
694697
yield task, id_, queue_name
695698
self.complete(id_)
696699
if self.is_empty():

0 commit comments

Comments
 (0)