Commit 25415654a4e by Pierre Augier

CHANGES and simplify example cython_bugs/purepy_nogil

parent bfdbfb94b98
......@@ -9,8 +9,10 @@ See the `ROADMAP.rst file
0.4.1 (2019-10-08)
------------------
- Better Cython backend (less bugs, better support for fused types, nonecheck,
cdivision, ...)
- Cython backend: less bugs, better support for fused types, nonecheck,
cdivision, ...
- Fix default parameters for Pythran
0.4.0 (2019-09-22)
------------------
......
......@@ -19,7 +19,7 @@ Note however, that this mode is currently still experimental and that we hit
simple Cython bugs which limit a lot what can be done in practice with the
Cython backend. For example:
- Pure-Python mode and fused types <https://github.com/cython/cython/issues/3142>
- Pure-Python mode and fused types https://github.com/cython/cython/issues/3142
- `cython.locals(arr=np.ndarray[...])` https://github.com/cython/cython/issues/3129
- Incompatibility ccall/nogil in pure-Python mode: https://github.com/cython/cython/issues/3169
- nogil and pxd in pure-Python mode: https://github.com/cython/cython/issues/3170
......
cdef cython.int add(cython.int a, cython.int b)
cimport cython
@cython.locals(n=cython.int, i=Py_ssize_t, result=cython.int)
cpdef use_add(cython.int n)
\ No newline at end of file
cdef inline int add(int a, int b) nogil
@cython.locals(n=int, i=int, result=int)
cpdef use_add(int n)
......@@ -13,4 +13,4 @@ def use_add(n):
with cython.nogil:
for i in range(n):
result = add(result, result)
return result
\ No newline at end of file
return result
# cython: language_level=3
import cython
cpdef inline cython.int add(cython.int a, cython.int b) nogil:
cpdef inline int add(int a, int b) nogil:
return a + b
cpdef use_add(cython.int n):
cdef Py_ssize_t i
cdef cython.int result = 1
cdef int i
cdef int result = 1
with cython.nogil:
for i in range(n):
result = add(result, result)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment