[Python-Dev] python optimization

Diez B. Roggisch deets at nospam.web.de
Sun Sep 18 06:16:09 EDT 2005


Neal Becker wrote:
> One possible way to improve the situation is, that if we really believe
> python cannot easily support such optimizations because the code is too
> "dynamic", is to allow manual annotation of functions.  For example, gcc
> has allowed such annotations using __attribute__ for quite a while.  This
> would allow the programmer to specify that a variable is constant, or that
> a function is pure (having no side effects).

Use pyrex. It is basically an python-syntax-clone C-Generator, and 
allows for type-annotation. It's supported by distutils, so that you can 
develop using pure python, and then take your critical code and move it 
to pyrex, with not too much effort.

Diez



More information about the Python-list mailing list