[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Alex Waygood
Alex Waygood added the comment: +1 for the proposed PR. Loop variables leaking into the global namespace creates an extra burden for typeshed when we have to wade through a long list of objects that our tests report are present at runtime but not in the typeshed stubs. It's not the end of th

[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +29173 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30993 ___ Python tracker ___ _

[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Nikita Sobolev
Change by Nikita Sobolev : -- nosy: +AlexWaygood ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue46565] Multiple modules leak `for` loop variables into module's namespace

2022-01-28 Thread Nikita Sobolev
New submission from Nikita Sobolev : Some variables created as `for X in ...` leak into module's namespace, where the loop is defined. I wrote a simple `flake8` plugin to find names that are used in `ast.Module` in `ast.For`, but not under `if __name__ == '__main__'` and are not used in `del`