Hi, during the Cython tutorial on EuroPython, an idea came up for improving the HTML annotation, that you get when running cython with -a
: Sometimes, it is not directly clear if an identifier in Python (e.g. module or function) is being treated in the C or Python domain. I remember a question during the tutorial where there was a Python math.sin
replaced by a C call to the sin
function. On another line, there was math.pi
being used which of course was not found in the C math library (there it is called M_PI
).
I wondered if there is a way to annotate the different identifiers in the HTML output somehow so that their treatment (C or Python) is more explicitly visible. In the described case above, the math.sin
would get e.g. a gray border (for C) whereas the math.pi
would have gotten e.g. a blue border (for Python).
This is just an idea so I am not totally sure if this would help people to understand more clearly what Cython is doing (if you look deeper in the generated C code, you will always know, but it is not so explicit). But for the cases I can remember, it might have helped me find those minor glitches much easier.
Is there anyone else who thinks this would be an improvement to the annotated HTML of the Python code?