This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author selik
Recipients selik
Date 2017-04-01.04:37:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za>
In-reply-to
Content
Minor, but it looks like someone decided to use a defaultdict but forgot to remove the checks for whether a key exists.

Creating a defaultdict(list):
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L100

Checking for the key, then initializing an empty list:
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L120

Again:
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/lib2to3/btm_matcher.py#L137

Because the ``results`` is getting returned, perhaps it'd be better to use a regular dict and dict.setdefault instead of a defaultdict.
History
Date User Action Args
2017-04-01 04:37:19seliksetrecipients: + selik
2017-04-01 04:37:19seliksetmessageid: <1491021439.17.0.48753104649.issue29957@psf.upfronthosting.co.za>
2017-04-01 04:37:19seliklinkissue29957 messages
2017-04-01 04:37:18selikcreate