Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Update: this can now be handled automatically (and more selectively) via an option. See http://wiki.cython.org/DifferencesFromPyrex

Imagine this simple file:

The generated code is slow though, because range() is slow. I can either manually change all ranges to the "from 1 <= i <= dim -1" idiom, but that's annoying. I prefer Cython to do it automatically (for example by providing a switch "--convertrange" or something, it doesn't have to be default).

Here is a simple script which does that:

attachment:convertRange.py

It opens a file, changes all range(..) to from ..., and prints the result to stdout. You need pyparsing to run it:

$ python convertRange.py exampleIn.pyx

produces:

attachment:exampleOut.pyx

Something went wrong with that request. Please try again.