monkeys paw 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 (mo
On Feb 28, 6:53 pm, monkeys paw 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)
>
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:
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