3 ms·
"The problem is that I don't know what methods the returned objects have available, and as such whether they are a duck or a tiger." I don't get this... Why no
by lqdc13 10y ago
"The problem is that I don't know what methods the returned objects have available, and as such whether they are a duck or a tiger."
I don't get this...
Why not do the following:
In [1]: import requests
In [2]: resp = requests.get('http://www.google.com')
In [3]: resp.
resp.apparent_encoding resp.iter_lines
resp.close resp.json
resp.connection resp.links
resp.content resp.ok
resp.cookies resp.raise_for_status
resp.elapsed resp.raw
resp.encoding resp.reason
resp.headers resp.request
resp.history resp.status_code
resp.is_permanent_redirect resp.text
resp.is_redirect resp.url
resp.iter_content
Now you can try each of those things and explore their methods.
- natch 10y ago>>> import requests Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'requests' Now, what was your question?
- snovv_crash 10y agoBecause I'm not always scripting - sometimes the work I'm doing takes 10 minutes of runtime to get to the end and I want to know what I'm writing before I run it. If Python wants to remain a scripting language forever then the docs are sufficient. But if it wants to graduate, and it seems a lot of people think it already has, then the libraries need to be better documented.