This version of the documentation is for the latest and greatest in-development branch of Cython. For the last release version, see here.

Navigation

  • next
  • previous |
  • Cython 3.0.0b1 documentation »
  • Tutorials

🤝 Like the tool? Help making it better! Your donation helps! 🤝

Tutorials¶

  • Basic Tutorial
    • The Basics of Cython
    • Cython Hello World
    • Fibonacci Fun
    • Primes
    • Primes with C++
    • Language Details
  • Calling C functions
    • Dynamic linking
    • External declarations
    • Naming parameters
  • Using C libraries
    • Defining external declarations
    • Writing a wrapper class
    • Memory management
    • Compiling and linking
  • Extension types (aka. cdef classes)
  • pxd files
    • __init__.pxd
  • Caveats
  • Profiling
    • Cython Profiling Basics
    • Profiling Tutorial
  • Unicode and passing strings
    • Python string types in Cython code
    • String literals
    • General notes about C strings
    • Passing byte strings
    • Accepting strings from Python code
    • Dealing with “const”
    • Decoding bytes to text
    • Encoding text to bytes
    • C++ strings
    • Auto encoding and decoding
    • Source code encoding
    • Single bytes and characters
    • Narrow Unicode builds
    • Iteration
    • Windows and wide character APIs
  • Memory Allocation
  • Embedding Cython modules in C/C++ applications
    • Initialising your main module
    • Embedding example code
  • Pure Python Mode
    • Augmenting .pxd
    • Magic Attributes
    • PEP-484 type annotations
    • Tips and Tricks
  • Working with NumPy
    • Adding types
    • Efficient indexing
    • Tuning indexing further
    • What typing does not do
    • More generic code
  • Working with Python arrays
    • Safe usage with memory views
    • Zero-overhead, unsafe access to raw C pointer
    • Cloning, extending arrays
    • API reference
  • Writing parallel code with Cython
    • Compilation
    • Element-wise parallel operations
    • Reductions
    • parallel blocks
  • Further reading
  • Related work
  • Appendix: Installing MinGW on Windows
    • Python 3.8+

Logo

Previous topic

Faster code via static typing

Next topic

Basic Tutorial

This Page

  • Show Source

Quick search

Navigation

  • next
  • previous |
  • Cython 3.0.0b1 documentation »
  • Tutorials
© Copyright 2023, Stefan Behnel, Robert Bradshaw, Dag Sverre Seljebotn, Greg Ewing, William Stein, Gabriel Gellner, et al.. Created using Sphinx 4.5.0.