Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: inheritance and how to use it

Reply
Thread Tools

Re: inheritance and how to use it

 
 
Dave Angel
Guest
Posts: n/a
 
      02-15-2013
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
inheritance, multiple inheritance and the weaklist and instance dictionaries Rouslan Korneychuk Python 8 02-10-2011 04:02 AM
Builtn super() function. How to use it with multiple inheritance? Andwhy should I use it at all? Lacrima Python 43 08-02-2010 09:28 PM
Private Inheritance and Publice Inheritance karthikbalaguru C++ 9 09-10-2007 01:05 PM
Private access modifier and Inheritance (Inheritance implementation in Java) maxw_cc Java 1 12-21-2003 11:38 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57