As discussed here, async generators make it very difficult to write cancellation-safe code, which is essential when you want to use timeouts (always) or directly cancel some tasks (not that rare either). I therefore think it's worth having a disabled-by-default check, TRIO900, which bans all async generators unless they have an @asynccontextmanager decorator.
As discussed here, async generators make it very difficult to write cancellation-safe code, which is essential when you want to use timeouts (always) or directly cancel some tasks (not that rare either). I therefore think it's worth having a disabled-by-default check,
TRIO900
, which bans all async generators unless they have an@asynccontextmanager
decorator.