Users Guide¶
Contents:
- Language Basics
- Extension Types
- Introduction
- Static Attributes
- Dynamic Attributes
- Type declarations
- Extension types and None
- Special methods
- Properties
- Subclassing
- C methods
- Forward-declaring extension types
- Fast instantiation
- Instantiation from existing C/C++ pointers
- Making extension types weak-referenceable
- Controlling cyclic garbage collection in CPython
- Controlling pickling
- Public and external extension types
- Public extension types
- Special Methods of Extension Types
- Sharing Declarations Between Cython Modules
- Interfacing with External C Code
- Source Files and Compilation
- Early Binding for Speed
- Using C++ in Cython
- Fused Types (Templates)
- Porting Cython code to PyPy
- Limitations
- Differences between Cython and Pyrex
- Python 3 Support
- Conditional expressions “x if b else y”
- cdef inline
- Assignment on declaration (e.g. “cdef int spam = 5”)
- ‘by’ expression in for loop (e.g. “for i from 0 <= i < 10 by 2”)
- Boolean int type (e.g. it acts like a c int, but coerces to/from python as a boolean)
- Executable class bodies
- cpdef functions
- Automatic range conversion
- More friendly type casting
- Optional arguments in cdef/cpdef functions
- Function pointers in structs
- C++ Exception handling
- Synonyms
- Source code encoding
- Automatic
typecheck
- From __future__ directives
- Pure Python mode
- Typed Memoryviews
- Implementing the buffer protocol
- Using Parallelism
- Debugging your Cython program
- Cython for NumPy users
- Cython at a glance
- Your Cython environment
- Installation
- Manual compilation
- The first Cython program
- Adding types
- Efficient indexing with memoryviews
- Tuning indexing further
- Declaring the NumPy arrays as contiguous
- Making the function cleaner
- More generic code
- Using multiple threads
- Where to go from here?
- Pythran as a Numpy backend