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 cito
Recipients cito
Date 2021-04-29.19:29:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org>
In-reply-to
Content
Just noticed the following code in urrlib.parse_qsl:

    pairs = [s1 for s1 in qs.split(separator)]
    for name_value in pairs:
        ...

see https://github.com/python/cpython/blob/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b/Lib/urllib/parse.py#L755

This looks like an unnecessary list comprehension to me, probably a relic of earlier code that used a nested list comprehension for splitting with two different separators.

Can't we just do this instead now, which is faster and shorter?

   for name_value qs.split(separator):

I can provide a PR if wanted.
History
Date User Action Args
2021-04-29 19:29:25citosetrecipients: + cito
2021-04-29 19:29:25citosetmessageid: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org>
2021-04-29 19:29:25citolinkissue43979 messages
2021-04-29 19:29:25citocreate