Several sites (e.g. Google, Wikipedia) don't like this User-Agent and they will return an error message when you try to access their pages using urllib:

>>> from urllib import urlopen
>>> page = urlopen('http://www.google.com/search?q=python')
>>> page.read()
[…]<b>Error</b><H1>Forbidden</H1>Your client does not have permission
to get URL <code>/search?q=python</code> from this server.[…]

This code creates an instance of MyOpener and saves the page http://www.useragent.org/ in the file useragent.html using the retrieve method. If you open the page you can see the User-Agent used by the script.
Note that, after you have created the instance of the class, the UA will be the same.