[twill] add_auth

John J Lee jjl at pobox.com
Tue Sep 19 12:04:55 PDT 2006


[...]
> (um, what the above paragraph means is: always use mechanize.Blah, not
> urllib2.Blah :-)
[...]

Just noticed this, also from mechanize page, but says it more clearly:


mechanize exports the complete interface of urllib2:

import mechanize
response = mechanize.urlopen("http://www.example.com/")
print response.read()

so anything you would normally import from urllib2 can (and should, by 
preference, to insulate you from future changes) be imported from 
mechanize instead. In many cases if you import an object from mechanize it 
will be the very same object you would get if you imported from urllib2. 
In many other cases, though, the implementation comes from mechanize, 
either because bug fixes have been applied or the functionality of urllib2 
has been extended in some way.


John



More information about the twill mailing list