Skip to content
Cython
EntityQ975594· pop 19· linked from 75 articles

Cython () is a superset of the programming language Python, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of C.

Key facts

Programming language.name
Cython
Programming language.logo
Cython logo.svg
Programming language.developer
Robert Bradshaw, Stefan Behnel, et al.
Programming language.license
Apache License 2.0
Programming language.programming language
Python
Programming language.influenced_by
C, Python
Programming language.operating_system
Windows, macOS, Linux
Programming language.file_ext
.pyx, .pxd, .pxi

via Wikipedia infobox

Official website

Cython: C-Extensions for Python

cython.org

Link to the official site · 28,636 chars · not written by Vinony

Source code

Cython translates Python code to C/C++ code, but additionally supports calling C functions and declaring C types on variables and class attributes. This allows broad to fine-grained manual tuning that lets the compiler generate very efficient C code from Cython code. This makes Cython the ideal language for wrapping external C libraries, and for fast C modules that speed up the execution of Python code. Cython has more than 70 million downloads per month on PyPI. You can support the Cython project via Github Sponsors or Tidelift . The original Pyrex program, which Cython is based on, was licensed "free of restrictions" (see below). Cython itself is licensed under the permissive Apache License . Started as a project in the early 2000s, Cython has outlived most other attempts at producing static compilers for the Python language. Numba , a Python extension that features a JIT compiler for a subset of the language, based on the LLVM compiler infrastructure (probably best known for its clang C compiler). It mostly targets numerical code that uses NumPy. mypyc , a static Python-to-C extension compiler, based on the mypy static Python analyser. Like Cython's pure Python mode , mypyc can make use of PEP-484 type annotations to optimise code for static types. Doc/About.html for a description of the language INSTALL.txt for installation instructions USAGE.txt for usage instructions Demos for usage examples

Excerpt from the source-code README · 6,028 chars · not written by Vinony

Wikidata facts

Official website
cython.org
Image
Cython CPython Ext Module Workflow.png
Show 5 more facts
inception
2007-07-28
source code repository URL
github.com/cython/cython
software version identifier
3.2.4
IRC channel URL
irc://irc.freenode.net/#cython
Sources (9)

via Wikidata · CC0

~7 min read

Article

8 sections
Contents
  • Design
  • History
  • Examples
  • Using in IPython/Jupyter notebook
  • Uses of Cython
  • See also
  • References
  • External links

Cython () is a superset of the programming language Python, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of C.

Cython is a compiled language that is typically used to generate CPython extension modules. Annotated Python-like code is compiled to C and then automatically wrapped in interface code, producing extension modules that can be loaded and used by regular Python code using the import statement, but with significantly less computational overhead at run time. Cython also facilitates wrapping independent C or C++ code into Python-importable modules.

Connections

Categories