You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undeprecate and document urllib.parse.unwrap #79578
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 bpo-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. bpo-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.
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.
New changeset 674ee12 by Cheryl Sabella (Rémi Lapeyre) in branch 'master': bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481) 674ee12
Activity
stevendaprano commentedon Dec 3, 2018
The urllib.parse module contains an undocumented function unwrap:
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 bpo-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. bpo-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.
merwok commentedon Dec 17, 2018
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.
csabella commentedon May 27, 2019
New changeset 674ee12 by Cheryl Sabella (Rémi Lapeyre) in branch 'master':
bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
674ee12
csabella commentedon May 27, 2019
Thanks for the report and for the patch. :-)