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 slingamn
Recipients christian.heimes, slingamn
Date 2022-02-14.17:00:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644858034.79.0.618526400496.issue46750@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the prompt response. As evidence that this was of concern to the development team in the past, here's an issue where the unnecessary import of idna was treated as a regression:

https://bugs.python.org/issue22127

The discussion there also examines the semantic change produced by the optimization (some invalid labels making it to a DNS lookup instead of being rejected) and doesn't consider it to be a breaking change (albeit a reason not to backport).

(I also see references in documentation to a discussion labeled "RFE #1472176", but am unable to find the actual bug tracker or database entry this refers to.)

A time cost of 15 milliseconds seems accurate to me. The RAM cost on my release build of Python 3.8.10 is about 600 KB in RSS (this is approximately 5% of the baseline interpreter usage).

I cannot reproduce the claim that `urllib.parse` imports stringprep or unicodedata:

    python3 -c "import sys, urllib.parse; assert 'stringprep' not in sys.modules"

    python3 -c "import sys, urllib.parse; assert 'unicodedata' not in sys.modules"

I am developing a new lightweight http library that does use urllib.parse; on my system, these patches allow it to function without importing stringprep, idna, or unicodedata:

https://github.com/slingamn/mureq
History
Date User Action Args
2022-02-14 17:00:35slingamnsetrecipients: + slingamn, christian.heimes
2022-02-14 17:00:34slingamnsetmessageid: <1644858034.79.0.618526400496.issue46750@roundup.psfhosted.org>
2022-02-14 17:00:34slingamnlinkissue46750 messages
2022-02-14 17:00:34slingamncreate