2 ms·
This Python code is "as expressive" as the Julia code because it's not written in idiomatic Python. Por ejemplo: for i in range(n): solution[i] = y
by heydenberk 13y ago
This Python code is "as expressive" as the Julia code because it's not written in idiomatic Python. Por ejemplo:
for i in range(n):
solution[i] = y[i]
when one could simply
solution[:n] = y[:n]
Don't mean to bikeshed, but this is one of many cases.
- ajtulloch 13y agoFWIW, benchmarks indicated that the former was faster than the latter. Remember, this is Cython, so the goal is to write code that is easily compiled into efficient C code, not to write idiomatic Python.