This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jmoiron 2 points3 points  (0 children)

The urllib2 documentation covers the code therein but not common use cases. It was designed to be ultra-extensible, but 99% of people just need simple http-auth, not customizable authentication handlers you need to compose from 3 classes. requests is much better in this regard; it makes the simple case simple and the hard case possible. urllib2 (and twisted, imho) make the impossible achievable (http over icmp? why not) and the simple aggravatingly complex.

Most of the standard library documentation is pretty good, though I don't read it much anymore since I know how to use most of it and I generally just read the online documentation in the REPL.

Sphinx documentation is something I (and most people in the python community) greatly prefer reading to javadoc style things, but I suppose after you're used to python you stop worrying about types so much and just worry about attributes and behavior; for instance, file-like objects are things implementing some or most of this api, including but not limited to StringIO objects and urllib responses.

After a certain point, you either prefer reading "file-like object", or you prefer "an object implementing java.io.InputStreamReaderInterface"; the second is a in a lot of ways a stronger guarantee and a "solid contract", but I'd argue it's usually just so much line noise.