Shivaram Lingamneni <sling...@cs.stanford.edu> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46750>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to