Individual Articles¶

I plan to also group some of these articles by theme, but for now they’re just in a big list.

  • What Cython is not designed for
    • Obfuscation
    • Creating Executables
    • Wrapping C++ classes
  • Don’t be afraid to lie to Cython
  • Beware automatic type conversions
    • The conversion isn’t free
    • Changes to not propagate back
  • The Python list is surprisingly good
    • Technical details about why you don’t need a special cdef-class-list:
    • What to do if you really want such a typed container
  • The bundled .pxd files aren’t magic
  • Consider your compiler directives carefully
    • cdef and cpdef functions
  • Try not to return typed memoryviews
  • Your Python interface need not match what it’s wrapping
    • double** matrices
    • vector<double>/vector<vector<double>> matrices
  • What’s the difference between def, cdef, and cpdef functions
    • Restrictions on cdef functions
    • Advantages of cdef functions
    • cpdef functions
    • Summary (or when to use a cdef function?)
  • You probably don’t need to release the GIL
    • Extra corollary
  • Memoryviews are views of existing memory
    • Allocation
    • Re-assignment
    • Slicing is (fairly) quick
    • Understanding the underlying data structure

Cython Guidelines

Navigation

Contents:

  • Themes
  • Individual Articles
    • What Cython is not designed for
    • Don’t be afraid to lie to Cython
    • Beware automatic type conversions
    • The Python list is surprisingly good
    • The bundled .pxd files aren’t magic
    • Consider your compiler directives carefully
    • Try not to return typed memoryviews
    • Your Python interface need not match what it’s wrapping
    • What’s the difference between def, cdef, and cpdef functions
    • You probably don’t need to release the GIL
    • Memoryviews are views of existing memory
  • Troubleshooting

Related Topics

  • Documentation overview
    • Previous: Themes
    • Next: What Cython is not designed for

Quick search

©2022, David Woods; licensed under CC-BY-NC-SA-4.0. | Powered by Sphinx 6.1.3 & Alabaster 0.7.13 | Page source