1. Why are you subclassing a module? 2. If you want to "mask" a module's version attribute, just do this: >>> import urllib2 >>> urllib2.__version__ = 'foo' >>> print urllib2.__version__ foo
~/santa On Mon, Feb 28, 2011 at 10:53 AM, monkeys paw <mon...@joemoney.net> wrote: > I'm trying to subclass urllib2 in order to mask the > version attribute. Here's what i'm using: > > import urllib2 > > class myURL(urllib2): > def __init__(self): > urllib2.__init__(self) > self.version = 'firefox' > > I get this> > Traceback (most recent call last): > File "<interactive input>", line 1, in <module> > TypeError: Error when calling the metaclass bases > module.__init__() takes at most 2 arguments (3 given) > > I don't see where i am supplying 3 arguments. What am i > missing? > > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list