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

Jason R. Coombs report at bugs.python.org
Thu Jan 27 09:29:53 EST 2022


Jason R. Coombs <jaraco at jaraco.com> 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 its changelog there too.

I'd be more inclined to accept a change like this on importlib_metadata, which has a faster iteration and whose changes get naturally incorporated into CPython periodically.

What's the harm in leaving this attribute on a class that is itself standing in for deprecated behavior and slated for removal?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46546>
_______________________________________


More information about the Python-bugs-list mailing list