This is probably not a bug, but I would like to use early return within async for message in messages: loop
ie.
async for message in messages:
try:
if message.topic.matches("not-interesting-topic/#"):
print(f"early return")
return
elif message.topic.matches("interesting-topic/#"):
do something
...
return used in first condition obviously breaks listening process and no more messages are received if return is applied. Is there a change to exit listening loop for only one message and continue receiving messages?
I am able to rewrite the code to completely avoid returns but I prefer to keep using it.
This is probably not a bug, but I would like to use early return within
async for message in messages:
loopie.
return used in first condition obviously breaks listening process and no more messages are received if return is applied. Is there a change to exit listening loop for only one message and continue receiving messages?
I am able to rewrite the code to completely avoid returns but I prefer to keep using it.