Cython, the toolkit that allows Python code to be converted to high-speed C code, has a new 0.27 release that can now use Python’s own native typing syntax to speed up the Python-to-C conversion process.Previously, Cython users could accelerate Python only by decorating the code with type annotations in a dialect peculiar to Cython. Python has its own optional syntax for variable type annotation, but Cython didn’t use it.[ Tutorial: How to get started with Python. | Go deeper with the InfoWorld megaguide: The best Python frameworks and IDEs. | Keep up with hot topics in programming with InfoWorld’s App Dev Report newsletter. ]
With Cython 0.27, Cython can now recognize PEP 526-style type declarations for native Python types, such as str or list.

The same syntax can also be used to explicitly define native C types, using declarations like declaration like var: = 32.To read this article in full or to leave a comment, please click here

Leave a Reply