Jacob Walls
Jacob Walls
Reported again in #8928.
@Pierre-Sassoulas were you able to reproduce? I tried with Python 3.9.2 and same pylint & astroid versions reported and could not.
> I think it's a pylint problem. Turns out it was an astroid problem. Regression test PR coming shortly, will fail until upgrading astroid.
I think we can refocus this on the issue and suggested patch identified [here](https://github.com/pylint-dev/pylint/issues/6476#issuecomment-1113889152). Should be a bite-sized contribution for someone.
Oops! epylint was removed in #7737. Sorry. Save your appetite for nibble on something else!
Apparently, even if the suggestion of the proposed checker is implemented, you still will have "cleanup code" executed at the wrong time if you use the context manager as a...
A python [discussion](https://discuss.python.org/t/preventing-yield-inside-certain-context-managers/1091) about how this (yielding out of a context manager managing a resource) is a bad pattern, and could possibly lead to a PEP at some point, but...
Overall looks good. I'd add some good cases with decorators e.g. `@cm()` that would otherwise be bad cases if they were redone as `with cm():` statements. (good is a misnomer;...
Ah, I see in the PR are you allowing yielding constants (as opposed to names) in addition to None as legal yields. So looking good, I'd just add a test...
In #9625 we're discussing the case you bring up, where there is no code after yield.