来源:Cython
浏览 449
扫码
分享
2020-04-04 08:24:55
0.15 (2011-08-05)
Features added
- Generators (yield) - Cython has full support for generators, generator expressions and PEP 342 coroutines.
- The nonlocal keyword is supported.
- Re-acquiring the gil: with gil - works as expected within a nogil context.
- OpenMP support: prange.
- Control flow analysis prunes dead code and emits warnings and errors about uninitialised variables.
- Debugger command cy set to assign values of expressions to Cython variables and cy exec counterpart $cy_eval().
- Exception chaining PEP 3134.
- Relative imports PEP 328.
- Improved pure syntax including cython.cclass, cython.cfunc, and cython.ccall.
- The with statement has its own dedicated and faster C implementation.
- Support for del.
- Boundschecking directives implemented for builtin Python sequence types.
- Several updates and additions to the shipped standard library .pxd files.
- Forward declaration of types is no longer required for circular references.
Bugs fixed
Other changes
- Uninitialized variables are no longer initialized to None and accessing them has the same semantics as standard Python.
- globals() now returns a read-only dict of the Cython module’s globals, rather than the globals of the first non-Cython module in the stack
- Many C++ exceptions are now special cased to give closer Python counterparts. This means that except+ functions that formerly raised generic RuntimeErrors may raise something else such as ArithmeticError.
- The inlined generator expressions (introduced in Cython 0.13) were disabled in favour of full generator expression support. This breaks code that previously used them inside of cdef functions (usage in def functions continues to work) and induces a performance regression for cases that continue to work but that were previously inlined. We hope to reinstate this feature in the near future.