Navigation
next
previous
|
Cython v0.15.1 documentation
»
Users Guide
¶
Contents:
Overview
About Cython
Future Plans
Basic 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
Using C++ in Cython
Overview
A simple Tutorial
Advanced C++ features
Caveats and Limitations
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
Using Parallelism
Compiling
Breaking
Nested Parallelism
Debugging your Cython program
Running the Debugger
Using the Debugger
Convenience functions
Configuring the Debugger
Indices and tables
¶
Index
Module Index
Search Page
Table Of Contents
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.15.1 documentation
»