Help with super()

Andy Gross andy at andygross.org
Tue Dec 7 09:27:07 EST 2004


Florian,

See: http://www.python.org/doc/newstyle.html

/arg


On Dec 7, 2004, at 5:38 AM, Florian Lindner wrote:

> 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
> -- 
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list