Cython 0.27 发布,Python 的 C 语言扩展

来源: 投稿
作者: 两味真火
2017-09-26 07:20:00

Cython 0.27 发布了。准确说Cython是单独的一门语言,专门用来写在Python里面import用的扩展库。实际上Cython的语法基本上跟Python一致,而 Cython有专门的“编译器”先将 Cython代码转变成C(自动加入了一大堆的C-Python API),然后使用C编译器编译出最终的Python可调用的模块。

新特性:

  • Extension module initialisation follows PEP 489 in CPython 3.5+, which resolves several differences with regard to normal Python modules. 

  • Asynchronous generators (PEP 525) and asynchronous comprehensions (PEP 530) have been implemented. 

  • Variable annotations are now parsed according to PEP 526

  • ……

bug 修复:

  • Extension types that were cimported from other Cython modules could disagree about the order of fused cdef methods in their call table. 

  • The exception state handling in generators and coroutines could lead to exceptions in the caller being lost if an exception was raised and handled inside of the coroutine when yielding. (Github issue #1731)

  • Loops over range(enum) were not converted into C for-loops. 

  • ……

本次更新内容较多,请查看更新日志

下载地址:

展开阅读全文
10 收藏
分享
3 评论
10 收藏
分享
返回顶部
顶部
返回顶部
顶部