[New-bugs-announce] [issue35397] Undeprecate and document urllib.parse.unwrap

Steven D'Aprano report at bugs.python.org
Mon Dec 3 18:25:50 EST 2018


New submission from Steven D'Aprano <steve+python at pearwood.info>:

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.

----------
messages: 331003
nosy: cheryl.sabella, serhiy.storchaka, steven.daprano
priority: normal
severity: normal
status: open
title: Undeprecate and document urllib.parse.unwrap
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35397>
_______________________________________


More information about the New-bugs-announce mailing list