[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev
Nikita Sobolev added the comment: Thanks, Jason! I've submitted https://github.com/python/importlib_metadata/pull/365 > What's the harm in leaving this attribute on a class that is itself standing > in for deprecated behavior and slated for removal? I think it does not do much harm, but the

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks Nikita for the report. I agree, it's inelegant that this property leaks. Because this code is synced with importlib_metadata, I'm not sure it's worth the effort of changing it here. Your change here implies a cherry-pick to the backport and updating

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

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

[issue46546] `importlib.metadata.DeprecatedList` leaks `method_name` variable

2022-01-27 Thread Nikita Sobolev
New submission from Nikita Sobolev : Right now in `DeprecatedList` there's a possibly unwated name leak of `method_name` here: https://github.com/python/cpython/blob/08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85/Lib/importlib/metadata/__init__.py#L295-L308 ``` for method_name in [ '__setit