Must we include urllib just to decode a URL-encoded string, when using Requests?

Dotan Cohen dotancohen at gmail.com
Thu Jun 13 09:52:45 EDT 2013


On Thu, Jun 13, 2013 at 4:44 PM, Burak Arslan
<burak.arslan at arskom.com.tr> wrote:
> On 06/13/13 16:25, Dotan Cohen wrote:
> paste this to your python console, it'll show you what modules requests
> imports:
>
> import sys
> p = set(sys.modules)
> import requests
> for m in sorted(set(sys.modules) - p):
>   print(m)
>

Thank you. Python is a beautiful language, I cannot believe that the
set(sys.modules)-p line does what it does!

Interestingly, on my system with Python3 neither urllib nor urllib2
are imported, only urllib3 which I had not heard of until now:

__future__
_json
atexit
cgi
chardet
html
http.cookiejar
http.cookies
json
json.decoder
json.encoder
json.scanner
logging
mimetypes
netrc
queue
requests
requests.api
requests.auth
requests.compat
requests.cookies
requests.defaults
requests.exceptions
requests.hooks
requests.models
requests.sessions
requests.status_codes
requests.structures
requests.utils
shlex
six
six.moves
threading
urllib3
urllib3._collections
urllib3.connectionpool
urllib3.exceptions
urllib3.filepost
urllib3.packages
urllib3.packages.mimetools_choose_boundary
urllib3.packages.ssl_match_hostname
urllib3.poolmanager
urllib3.request
urllib3.response
urllib3.util


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



More information about the Python-list mailing list