Is this Pythonic?
phil hunt
zen19725 at zen.co.uk
Mon Aug 1 17:18:36 EDT 2005
On Mon, 01 Aug 2005 22:01:06 +0200, Caleb Hattingh <caleb1 at telkomsa.net> wrote:
>Peter
>
>To my mind, this kind of setup (interface class, or abstact class) is more
>usually used in static languages to benefit polymorphism - but python is
>dynamically typed, so in which situations would this setup be useful in a
>python program? You see, I expected your post to say that it wouldn't
>even be necessary, but you didn't :)
I realise it's not necessary. I just thought it would be nice to
document the interfaces my concrete classes will be using.
>I have spent a little effort training myself not to bother setting up
>class hierarchies like this in python, due to the fact that I use Delphi a
>lot at work (I do pretty much the code below to let myself know when an
>inherited/abstract class method is being called in error).
I started doing OO stuff with Smalltalk, where it isn't necessary,
then moved to C++, where it is, and liked it.
--
Email: zen19725 at zen dot co dot uk
More information about the Python-list
mailing list