typechecking etc??

Courageous jkraska1 at san.rr.com
Sat Aug 18 12:26:56 EDT 2001


>Talking about compiler efficiency, is there any way to write an extension
>that would allow python to be optionally strongly typed?

Python already _is_ strongly typed. What you mean is optional _static_ typing.

It wouldn't be too hard to alter the python parser to accept static type information
and to allow for declarations, but this is only a small part of getting a compiler
to compile efficiently for a dynamic language. I think the folks who keep on asking
for this are quite myopic about it. For performance, it's not nearly as important as
you think.

The main argument in favor of static typing is that static typing reveals coding
errors up front. This argument, however, has no real place in Python, which is
a _dynamic_ language designed for programmers who _like_ dynamic
languages. In other words, you're barking up the wrong language tree (IMO).

Lisp has had optional _static_ declarations for years; they tend not to be used,
as most Lisp programmers don't even think that way, would rather not think that
way, find it too limiting.

C//




More information about the Python-list mailing list