[Compiler-sig] Polymorphism/encapsulation in Python

Binks, Dominic DBinks@scigen.co.uk
Wed, 5 Apr 2000 09:06:22 +0100


I would very much agree with this having used Python embedded.  I always had
to put exception handling round the main function/method called in order to
catch problems.  Often these could have been caught by some static type
check tool.  Even if the static types/interfaces just generated asserts for
you that would be a real help.

Dominic Binks
Scientific Generics Ltd.

-----Original Message-----
From: Rafael H Schloming [mailto:rhs@MIT.EDU]
Sent: 04 April 2000 20:39
To: John Max Skaller
Cc: Ludvig Svenonius; compiler-sig@python.org; guido@python.org
Subject: Re: [Compiler-sig] Polymorphism/encapsulation in Python 

I've written large scale software in python that had very complicated
class heirarchies with litteraly thousands of different classes. I
think python scaled very well to this level and I would choose it over
any other language, but what I found myself doing was putting in an
assert for every single argument in order to catch little slips like
swapping two arguments or passing in the wrong value somewhere.
Without these asserts the system would have been difficult to debug
because the errors wouldn't show up until very far beyond the place
where the actual bug occured. An interface mechanism would have
allowed me to express my asserts much more tersely and would have made
my code far more generic since I would be asserting things like
arg_foo satisfies interface bar instead of isinstance(arg_foo, ClassBar)
where ClassBar is just a specific implementation of interface bar.

--Rafael H. Schloming <rhs@mit.edu>

_______________________________________________
Compiler-sig mailing list
Compiler-sig@python.org
http://www.python.org/mailman/listinfo/compiler-sig