Book Image

Learning Cython Programming (Second Edition) - Second Edition

By : Philip Herron
Book Image

Learning Cython Programming (Second Edition) - Second Edition

By: Philip Herron

Overview of this book

Cython is a hybrid programming language used to write C extensions for Python language. Combining the practicality of Python and speed and ease of the C language it’s an exciting language worth learning if you want to build fast applications with ease. This new edition of Learning Cython Programming shows you how to get started, taking you through the fundamentals so you can begin to experience its unique powers. You’ll find out how to get set up, before exploring the relationship between Python and Cython. You’ll also look at debugging Cython, before moving on to C++ constructs, Caveat on C++ usage, Python threading and GIL in Cython. Finally, you’ll learn object initialization and compile time, and gain a deeper insight into Python 3, which will help you not only become a confident Cython developer, but a much more fluent Python developer too.
Table of Contents (14 chapters)
Learning Cython Programming Second Edition
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

AutoPXD


When it comes to writing Cython modules most of your work will comprise of get-ting your pxd declarations correct so that you can manipulate native code correctly. There are several projects attempting to create a compiler to read C/C++ headers and generate your pxd declarations as output. The main issue is maintaining a fully compliant C and C++ parser. Part of my Google Summer of Code project was to use the Python plugin system as part of GCC to reuse GCC's code for parsing C/C++ code. The plugin could intercept the declarations, types and prototypes. It isn't fully ready for use and there are other similar projects attempting the same issue. More information can be found at https://github.com/cython/cython/wiki/AutoPxd.