super not working in __del__ ?

Discussion in 'Python' started by Christopher J. Bottaro, Feb 15, 2005.

  1. I get this exception when I run the following code:

    Exception exceptions.TypeError: 'super() argument 1 must be type, not None'
    in <bound method Txrposdn.__del__ of <__main__.Txrposdn object at
    0xf6f7118c>> ignored

    Here is the code:

    class Txrposdn(PRI.BasicBatch):

    def __init__(self, *argv):
    super(Txrposdn, self).__init__(*argv)

    def __del__(self):
    super(Txrposdn, self).__del__()

    if __name__ == "__main__":
    prog = Txrposdn(args)
    prog.go()


    The weird thing is that if move that last code segment into its own
    function, the exception doesn't happen:

    def main():
    prog = Txrposdn(args)
    prog.go()

    if __name == "__main__":
    main()

    What is going on? Thanks for the help.
     
    Christopher J. Bottaro, Feb 15, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    super.super.super how?

    Guest, Feb 19, 2005, in forum: Java
    Replies:
    24
    Views:
    10,821
    Darryl Pierce
    Feb 24, 2005
  2. Fredrik Lundh

    Re: super not working in __del__ ?

    Fredrik Lundh, Feb 16, 2005, in forum: Python
    Replies:
    5
    Views:
    600
    Duncan Booth
    Feb 16, 2005
  3. Christopher J. Bottaro

    Re: super not working in __del__ ?

    Christopher J. Bottaro, Feb 16, 2005, in forum: Python
    Replies:
    5
    Views:
    784
    Jeff Shannon
    Feb 18, 2005
  4. Replies:
    7
    Views:
    450
    Patricia Shanahan
    Apr 6, 2008
  5. Hugh Sasse Staff Elec Eng

    Inheriting variables, super, and "not super"?

    Hugh Sasse Staff Elec Eng, Dec 9, 2003, in forum: Ruby
    Replies:
    7
    Views:
    131
    Hugh Sasse Staff Elec Eng
    Dec 11, 2003
Loading...

Share This Page