Re: Subclassing zipfile (new style class)

2007-09-06 Thread Matimus
> import zipfile > class walkZip(zipfile): > pass > > if __name__ == "__main__": > print "Hello World" `zipfile' is the name of the module, not a class. What you probably want is this: [code] import zipfile class WalkZip(zipfile.ZipFile): pass if __name__ == "__main__": print

Re: Subclassing zipfile (new style class)

2007-09-06 Thread Farshid Lashkari
Larry Bates wrote: > import zipfile > class walkZip(zipfile): > pass > > > if __name__ == "__main__": > print "Hello World" > > Traceback (most recent call last): > File "", line 192, in run_nodebug > File "", line 2, in > TypeError: Error when calling the metaclass bases > modu

Re: Subclassing zipfile (new style class)

2007-09-06 Thread Tom Brown
On Thursday 06 September 2007 16:15, Larry Bates wrote: > I'm trying to learn about subclassing new style classes and the first > project I went to do needs to subclass zipfile to add some methods. > > > Why does this: > > import zipfile > class walkZip(zipfile): > pass > > > if __name__ == "_

Subclassing zipfile (new style class)

2007-09-06 Thread Larry Bates
I'm trying to learn about subclassing new style classes and the first project I went to do needs to subclass zipfile to add some methods. Why does this: import zipfile class walkZip(zipfile): pass if __name__ == "__main__": print "Hello World" Traceback (most recent call last):