<br clear="all">1. Why are you subclassing a module?<br><div>2. If you want to "mask" a module's version attribute, just do this:</div><div>    >>> import urllib2</div><div>    >>> urllib2.__version__ = 'foo'</div>

<div>    >>> print urllib2.__version__<br></div><div>    foo<br></div><div><br></div>~/santa<br>
<br><br><div class="gmail_quote">On Mon, Feb 28, 2011 at 10:53 AM, monkeys paw <span dir="ltr"><<a href="mailto:monkey@joemoney.net">monkey@joemoney.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I'm trying to subclass urllib2 in order to mask the<br>
version attribute. Here's what i'm using:<br>
<br>
import urllib2<br>
<br>
class myURL(urllib2):<br>
    def __init__(self):<br>
        urllib2.__init__(self)<br>
        self.version = 'firefox'<br>
<br>
I get this><br>
Traceback (most recent call last):<br>
  File "<interactive input>", line 1, in <module><br>
TypeError: Error when calling the metaclass bases<br>
module.__init__() takes at most 2 arguments (3 given)<br>
<br>
I don't see where i am supplying 3 arguments. What am i<br>
missing?<br><font color="#888888">
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>