[stdlib-sig] Problem with removing urllib

Brett Cannon brett at python.org
Fri Mar 14 20:39:27 CET 2008


I just realized there is an issue with the planned removal of urllib.
Up to this point all renamings have been a direct mapping of one
module to another one that had all the previously available objects.
The removal of urllib would break this. This would be especially
troublesome in the situation where someone was using urllib for its
parsing functions:

  from url import parse as urllib

That could leave to odd looks from users wondering why
urllib.URLOpener no longer exists. And you can't tack on another
import to get at URLOpener:

  from url import parse as urllib
  from url import requeset as urllib  # Overwrites previous import!

It seems to me that either we have to pretend urllib is not moved over
to Python 3.0 at all and have people manually move over code, or we
stick urllib into url.fetch and also copy the parse code over to
url.parse (and possibly cgi's one useful parsing function). That way
previous urllib owners can have 2to3 do:

  from url import fetch as urllib

and not end up with confusing AttributeErrors. And consolidating all
the parse functions into url.parse now will also allow for an eventual
deprecation of urllib the old-fashioned way in 3.x.

Does this all make sense? Or am I worrying too much?

-Brett


More information about the stdlib-sig mailing list