Problem with removing urllib
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
2008/3/14, Brett Cannon
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
The one cgi's useful parsing function is "cgi.parse_qs" (the qs is from "query string"). I saw zillion times people using urrlib and import cgi only for this function.
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?
I strongly prefer an error (or some additional work) in the migration, than get some confusing states. Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/
participants (2)
-
Brett Cannon
-
Facundo Batista