Types, Cython, program readability

sturlamolden sturlamolden at yahoo.no
Sun Mar 16 11:01:07 EDT 2008


On 16 Mar, 15:32, bearophileH... at lycos.com wrote:
> It seems the development of Cython is going very well, quite
> differently from the dead-looking Pyrex. Hopefully Cython will become
> more user-friendly too (Pyrex is far from being user-friendly for
> Windows users, it doesn't even contain a compiler, I think. The

Pyrex is not dead. And although it may come as a surprise to you,
Pyrex IS a compiler.

Pyrex does not contain a C compiler. But why should it? There are
Microsoft Visual C++, MinGW, Cygwin, lcc, Borland C++, Intel C++
compiler, OpenWatcom, among others. Get your favourite.

Being written in pure Python, Pyrex is equally easy to use on Windows
and Linux. You have to use the command prompt or disttools on either
platform.



> The (little) point of this post: sometimes (when the programmer is
> quite lazy) statically typed code is more "readable" than Python code.

If your task is to translate a Python program into a statically typed
language, type annotations can be helpful. But you don't need types to
read a/b as 'a divided by b'.











More information about the Python-list mailing list