Flying With Python (Strong versus Weak Typing)
joshway-without-spam at myway.com
Fri Mar 14 14:23:07 CET 2003
Alex Martelli <aleax at aleax.it> 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
> -- 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