Next: Optimization
Up: Advanced Compiler Introduction
Previous: Advanced Compiler Introduction
  Contents
  Index
Python's support for types is unusual in three major ways:
- Precise type checking encourages the specific use of type
declarations as a form of run-time consistency checking. This
speeds development by localizing type errors and giving more
meaningful error messages. See section precise-type-checks. Python
produces completely safe code; optimized type checking maintains
reasonable efficiency on conventional hardware
(see section type-check-optimization.)
- Comprehensive support for the Common Lisp type system makes complex
type specifiers useful. Using type specifiers such as or and
member has both efficiency and robustness advantages.
See section advanced-type-stuff.
- Type inference eliminates the need for some declarations, and
also aids compile-time detection of type errors. Given detailed
type declarations, type inference can often eliminate type checks
and enable more efficient object representations and code sequences.
Checking all types results in fewer type checks. See sections
5.3 and 5.11.2.
Peter Van Eynde
2001-03-08