Re: inheritance and how to use it

Discussion in 'Python' started by Dave Angel, Feb 15, 2013.

  1. Dave Angel

    Dave Angel Guest

    On 02/15/2013 01:28 PM, Bob Brusa wrote:
    >
    >> <snip>


    >>

    >
    > to make it more clear, I attach a cut-down version of my program. It
    > includes comments to explain in more detail what my problem is.
    > Bob
    >


    Good job cutting down the sample. Naturally, it'd have been smart to
    tell us you don't get the same traceback this way. But it looks like
    the first problem is in that missing __init__() method. Instead of
    saying "it doe not work" it'd be good to examine just what error
    traceback you got when you did have it there. I suspect it's because
    you're passing parameters in when you invoke it (iodev, baud_rate =
    57600) but you don't have any arguments. You don't even have the self
    argument.

    You are also missing the super call, as outlined earlier in this thread.
    So the base class won't being properly initialized once you fix the
    first problem.

    Reread Thomas Rachel's message, and if you still can't make it work,
    tell us what errors you still get, or what you don't understand.




    --
    DaveA
    Dave Angel, Feb 15, 2013
    #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. maxw_cc
    Replies:
    1
    Views:
    3,120
    Martijn van Steenbergen
    Dec 21, 2003
  2. cppsks
    Replies:
    0
    Views:
    806
    cppsks
    Oct 27, 2004
  3. karthikbalaguru
    Replies:
    9
    Views:
    1,026
  4. Lacrima
    Replies:
    43
    Views:
    790
    Mark Lawrence
    Aug 2, 2010
  5. Rouslan Korneychuk
    Replies:
    8
    Views:
    589
    Rouslan Korneychuk
    Feb 10, 2011
Loading...

Share This Page