Flying With Python (Strong versus Weak Typing)

jcm joshway-without-spam at
Fri Mar 14 14:23:07 CET 2003

Alex Martelli <aleax at> wrote:

> I've often daydreamed about having a language where I can offer
> such hints and compile my programs in at least two ways:

> -- a debugging mode, where hints let the compiler insert checks
>    for me and raise warnings or errors when my hints don't match
>    reality,
> -- an optimizing mode, where the compiler trusts the hints (at
>    least to some extent) and uses them to make fast code.

Python (the language) basically has this, in the form of assertions.
python (the compiler/interpreter) just doesn't have an
"optimize-dangerously" mode to take advantage of them.  It would be
possible to write a compiler for Python to do what you suggest.

More information about the Python-list mailing list