darglint
darglint copied to clipboard
DAR301 on empty yield
With a plain yield in a function, I get DAR301. Should it ignore this, when there is no value being yielded?
I can see the argument for ignoring it, since it should do the same for a plain return statement. And if the yielded value isn't expected to be used, it doesn't need to be documented.
I honestly never imagined a use case for a plain yield. Are you updating shared state and using the generator to control the flow?
See: https://docs.aiohttp.org/en/stable/web_advanced.html#cleanup-context
The yield is basically just a break point between setting something up and cleaning it up when finished.