I would like type checking only if it buys me something. The main
thing it could get me, maybe, is more efficient implementation. One of
the reasons for writing a module in C at the moment is efficiency. For
instance, my midi file parser in python is nice and elegant, but too
slow. It would be really nice if I could give python some hints along
the lines of 'this argument will always be a string' and have it
generate more efficient code.
Your function f() is currently as easily coded as
def f(str, seq):
if type(str) <> type('') or not hasattr(seq, '__getitem__'):
raise ArgumentError
and if I really care about error checking I'll write out the second
form as easily as the first. If the syntax were more concise, though,
I could see myself using it more often (argument checking??? whoooaaaaa:-).
-- Jack Jansen | If I can't dance I don't want to be part of Jack.Jansen@cwi.nl | your revolution -- Emma Goldman uunet!cwi.nl!jack G=Jack;S=Jansen;O=cwi;PRMD=surf;ADMD=400net;C=nl