Home

On 2007-08-31, bambam <david@asdf.asdf> wrote:
> "Bruno Desthuilliers"
> <bruno.42.desthuilliers@wtf.websiteburo.oops.com> wrote in
> message news:46d2ba7a$0$430$426a74cc@news.free.fr...
>> 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

previous
next

Re: Error: aggregate value used where an integer was expected
Re: Finding documentation (WAS: Iteration over strings)
Re: Template-Meta: Finding out whether a template-definition exists
Re: Needless copying in iterations?
Re: Where is Shiva?
Fundacja Hobbit
Kidprotect
Nasze Dzieci
Mam Marzenie
Fundacja Avalon