Welcome to Cython Guidelines!¶

The project aims to give general guidelines and good advice about using Cython - how you should use it, what it’s suitable for, potential pitfalls, and so forth. It’s largely my personal opinion as opposed to strict documentation.

Contents:

  • Themes
    • Have a separate “Python” and “Cython” interface
    • Memoryviews
  • 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
    • Issues when embedding
    • Where the language is “messy”
    • AttributeErrors
    • Extension type class attributes vs instance attributes

Indices and tables¶

  • Index

  • Module Index

  • Search Page

Cython Guidelines

Navigation

Contents:

  • Themes
  • Individual Articles
  • Troubleshooting

Related Topics

  • Documentation overview
    • Next: Themes

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