Learning Cython Programming
Cython is a very powerful combination of Python and C. Using Cython, you can write Python code that calls back and forth from and to C or C++ code natively at any point. It is a language with extra syntax allowing for optional static type declarations. It is also a very popular language as it can be...
Gespeichert in:
| 1. Verfasser: | |
|---|---|
| Format: | E-Book |
| Sprache: | Englisch |
| Veröffentlicht: |
Birmingham
Packt Publishing
2013
Packt Publishing, Limited |
| Ausgabe: | 1 |
| Schlagworte: | |
| ISBN: | 9781783280797, 1783280794 |
| Online-Zugang: | Volltext |
| Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Inhaltsangabe:
- Title Page Preface Table of Contents 1. Cython Won't Bite 2. Understanding Cython 3. Extending Applications 4. Debugging Cython 5. Advanced Cython Index
- Classes -- C++ new keyword and allocation -- Exceptions -- Bool type -- Overloading -- Templates -- Static class member attribute -- Caveat on C++ usage -- Calling in C and C++ functions -- Namespaces -- Python distutils -- Python threading and GIL -- Atomic instructions -- Read/write lock -- Cython keywords -- Messaging server revisited -- More inspiration -- Messaging server working with SQL -- Python IRC notifier -- Unit testing the native code -- Preventing subclassing -- Cython typing via annotations -- Parsing large amounts of data -- Summary -- 6. Further Reading -- Keyword cpdef -- OpenMP support -- Object initialization -- Compile time -- Python 3 -- Using PyPy -- AutoPXD -- Pyrex versus Cython -- SWIG versus Cython -- Cython and NumPy -- Numba versus Cython -- Parakeet and Numba -- GCCPy Python frontend to GCC -- Links and further reading -- Summary -- Index
- Intro -- Learning Cython Programming -- Table of Contents -- Learning Cython Programming -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Cython Won't Bite -- What this book is -- What this book isn't -- Installing Cython -- The emacs mode -- Getting the code examples -- Hello World -- Module on your own -- Calling into your C code -- Type conversion -- Summary -- 2. Understanding Cython -- Cython cdef -- Linking models -- The public keyword -- Logging into Python -- Python ConfigParser -- Cython cdef syntax and usage reference -- Structs -- Enums -- Typedef and function pointers -- Scalable asynchronous servers -- C sockets with libevent -- What is libevent? -- Messaging engine -- Cython callbacks -- Cython PXD -- Python messaging engine -- Integration with build systems -- Python distutils -- GNU/Autotools -- Summary -- 3. Extending Applications -- Cython pure Python code -- Python bindings -- Python garbage collector -- Extending Tmux -- Tmux build system -- Embedding Python -- Cythonizing struct cmd_entry -- Implementing a Tmux command -- Hooking everything together -- Compiling pure Python code -- Summary -- 4. Debugging Cython -- Using GDB on your code -- Running cygdb -- General Cython caveats -- Type checking -- No * operator -- Python exceptions in C -- For loops on C types -- Bool type -- No C const -- Multiple Cython files -- Initializing struct -- Calling into pure Python modules -- Keeping call stacks small and pure -- Summary -- 5. Advanced Cython -- C++ constructs -- Namespaces

