Sunday, January 02, 2005

The Type Declaration Compromise

Oliver Steele does a better job than me at explaining my position on optional type declarations. (Via Patrick Logan's blog.)

Anyway, he's given a pretty decent summation of my interest in type declarations, even though he doesn't mention adaptation. Syntactical support for adaptation would actually be a use case where a declaration syntax would be as good or better than the current alternative.

But in an off-list e-mail today on a related subject (an idea for better function signature introspection, independent of argument typing), Guido mentioned that:
"Adaptation is one use case for having a better type system, but I don't want to focus so much on run-time use of the types (although the types will be inspectable at runtime of course). I've thought about the motivation, and I've come to the conclusion that my own primary motivation is to be able to integrate PyChecker into the core; the type annotations should help it where it gets stuck. But please don't reply here, read the next blog entry (hopefully I'll find time for it this week)."
You probably also shouldn't bother commenting here either, as he also mentioned that he rarely reads blogs, and if he hadn't written it himself, he'd probably have missed his own article about type declaration. :)