Help with super()

Florian Lindner Florian.Lindner at xgm.de
Tue Dec 7 05:38:58 EST 2004


Steven Bethard schrieb:
> Christopher J. Bottaro wrote:
> 
>> Why don't this code work?
>>
>> import PRI
>>
>> class Poscdnld_PYIO(PRI.BasicBatch):
>>       def __init__(self, *argv):
>>       super(Poscdnld_PYIO, self).__init__(*argv)
>>
>> x = Poscdnld_PYIO()
>>
>> I get this exception:
>> File "poscdnld_pyio.py", line 52, in __init__
>>     super(Poscdnld_PYIO, self).__init__(*argv)
>> TypeError: super() argument 1 must be type, not classobj
>>
>> What am I doing wrong?  Thanks.
>>
> 
> I don't know what PRI is, but I suspect that PRI.BasicBatch is a classic 
> class, not a new-style class.  The super function only works for 
> new-style classes:

Never heard of new-stype and classiv-class... What are the differences?

Thx,

Florian



More information about the Python-list mailing list