[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker ___

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +24486 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25798 ___ Python tracker

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Yeah, the Quoter class seems a little odd... Past notes of some the caching performance around the character quoting for quote() can be found in https://bugs.python.org/issue1285086 circa 2005-2010. -- nosy: -rhettinger

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: While you're cleaning up the module, take a look at the Quoter class. It overrides __init__ and __missing__, so Quoter is not using any of the defaultdict features at all. I'm thinking it could just inherit from dict. -- nosy: +rhettinger

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
New submission from Gregory P. Smith : `urllib.parse` has custom caching code for both `urlsplit()` and `quote()`. From 1996. https://github.com/python/cpython/commit/3fd32ecd9232fcb041b9f1f7a19a1e7e65cf11a0 https://github.com/python/cpython/commit/74495409861b357d9925937d6576229c74e2550d