You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This clearly is not susceptible to the problem of "task might not start before yielding" though, bar is not just guaranteed to start before the yield, it's even guaranteed to finish.
It should be fairly straightforward to hold potential async113 errors in @asynccontextmanagers, and only raise them if a yield is encountered later in the same nursery.
Another example:
@asynccontextmanagerasyncdeffoo():
# do stuffyieldasyncwithtrio.open_nursery() asnursery:
nursery.start_soon(bar)
Here we can entirely ignore any start_soons after the yield, although that might get tripped up up by weird complicated logic with conditional yields. But it would also get handled by the logic of "only error if followed by yield in the same nursery" anyway, so should just go with that.
The text was updated successfully, but these errors were encountered:
Currently this will raise ASYNC113, start-soon-in-aenter:
This clearly is not susceptible to the problem of "task might not start before yielding" though,
bar
is not just guaranteed to start before the yield, it's even guaranteed to finish.It should be fairly straightforward to hold potential async113 errors in
@asynccontextmanager
s, and only raise them if a yield is encountered later in the same nursery.Another example:
Here we can entirely ignore any
start_soon
s after theyield
, although that might get tripped up up by weird complicated logic with conditional yields. But it would also get handled by the logic of "only error if followed by yield in the same nursery" anyway, so should just go with that.The text was updated successfully, but these errors were encountered: