On 2007-08-31, bambam <[EMAIL PROTECTED]> wrote: > "Bruno Desthuilliers" > <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> As a side note, in Python, inheritance ... ... should usually >> not be used for typing. > >:~( > I'm sorry, I don't even know what that means... The code I have > inherited from someone only a little more knowledgeable than > me, and is still full of development artifacts anyway. > > The Pwr and Psp classes inherit from the Device class not > neccessarily because that is a Good Thing, more because the > development process led to them being thought of that way. All > devices have a mixture of common and differing attributes. > > What is 'typing'?
In a language with strict types, you may need to make a set of classes all inherit from one base class simply in order to get the code to compile. A common example is a set of classes that all behave like file streams. You don't need to do this in Python. Simply have the object provide the right methods and you are done. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list