Navigation
next
previous
|
Cython v0.12 documentation
»
Old Cython Users Guide
¶
Contents:
Overview
About Cython
Future Plans
Tutorial
The Basics of Cython
Cython Hello World
pyximport
: Cython Compilation the Easy Way
Fibonacci Fun
Primes
Language Details
Language Basics
C variable and type definitions
Python functions vs. C functions
Automatic type conversions
Statements and expressions
The include statement
Conditional Compilation
Extension Types
Introduction
Attributes
Type declarations
Extension types and None
Special methods
Properties
Subclassing
C methods
Forward-declaring extension types
Making extension types weak-referenceable
Public and external extension types
Public extension types
Special Methods of Extension Types
Declaration
Docstrings
Initialisation methods:
__cinit__()
and
__init__()
Finalization method:
__dealloc__()
Arithmetic methods
Rich comparisons
The
__next__()
method
Special Method Table
Sharing Declarations Between Cython Modules
Definition and Implementation files
What a Definition File contains
What an Implementation File contains
The cimport statement
Sharing C Functions
Sharing Extension Types
Interfacing with External C Code
External declarations
Using Cython Declarations from C
Source Files and Compilation
Basic setup.py
Cython Files Depending on C Files
Multiple Cython Files in a Package
Distributing Cython modules
Pyximport
Wrapping C++ Classes in Cython
Overview
Procedure Overview
An example C++ API
Specify C++ language in setup.py
Create cdef extern from block
Create Cython wrapper class
Caveats and Limitations
Conclusion
Cython for NumPy users
Cython at a glance
Your Cython environment
Installation
Manual compilation
The first Cython program
Adding types
Efficient indexing
Tuning indexing further
More generic code
The future
Profiling
Cython Profiling Basics
Profiling Tutorial
Limitations
Unsupported Python Features
Other Current Limitations
Differences between Cython and Pyrex
Python 3.0 Support
Conditional expressions “x if b else y” (python 2.5)
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
Early Binding for Speed
Indices and tables
¶
Index
Module Index
Search Page
Table Of Contents
Old Cython Users Guide
Indices and tables
Previous topic
Appendix: Installing MinGW on Windows
Next topic
Overview
This Page
Show Source
Quick search
Navigation
next
previous
|
Cython v0.12 documentation
»