Title: Undeprecate and document urllib.parse.unwrap
Type: enhancement Stage: patch review
Components: Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cheryl.sabella, eric.araujo, serhiy.storchaka, steven.daprano
Priority: normal Keywords: patch, patch, patch

Created on 2018-12-03 23:25 by steven.daprano, last changed 2019-01-09 17:13 by remi.lapeyre.

Pull Requests
URL Status Linked Edit
PR 11481 open remi.lapeyre, 2019-01-09 17:13
PR 11481 open remi.lapeyre, 2019-01-09 17:13
PR 11481 open remi.lapeyre, 2019-01-09 17:13
Messages (2)
msg331003 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2018-12-03 23:25
The urllib.parse module contains an undocumented function unwrap:

    unwrap('<URL:type://host/path>') --> 'type://host/path'

This is useful. I've been re-inventing this function in many of my scripts, because I didn't know it existed (not documented!) and only stumbled across it by accident today, where I see it was deprecated in  #27485 but I can't see any reason for the deprecation.

If not for the deprecation, I would certainly use this unwrap function in preference to rolling my own.

It seems to me that this might have been a case of an over-enthusiastic change. #27485 talks about deprecating the various split* functions, which are officially redundant (urlparse and urlsplit are preferred) but doesn't talk about unwrap, which is useful and (in my opinion) should have been documented rather than deprecated.
msg331945 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2018-12-17 03:47
I suspect the only reason was that unwrap was caught in the bag of «undocumented functions (that don‘t seem useful)».

Personally I think I see more bare URLs than URLs in angle brackets these days, and `URL:` feels like an archaic marker :)  But I don’t see any harm in un-deprecating and documenting the function now that you say you would find it useful.
Date User Action Args
2019-01-09 17:14:07remi.lapeyresetkeywords: + patch
stage: patch review
pull_requests: + pull_request10998
2019-01-09 17:14:01remi.lapeyresetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10997
2019-01-09 17:13:54remi.lapeyresetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10996
2018-12-17 03:47:13eric.araujosetnosy: + eric.araujo
messages: + msg331945
2018-12-03 23:25:50steven.dapranocreate