New submission from Steven D'Aprano <steve+pyt...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue35397>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to