Cython: Difference between revisions

Content deleted Content added
m Copyedit
 
Line 11:
| influenced_by = [[C (programming language)|C]], [[Python (programming language)|Python]]
| operating_system = [[Windows]], [[macOS]], [[Linux]]
| file_ext = .pyx, .pxd, .pxi <ref>{{Cite web |title=Language Basics — Cython 3.0.0a9 documentation |url=https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types |access-date=9 September 2021 |website=cython.readthedocs.io}}</ref>
| website = {{official URL}}
}}
Line 17:
'''Cython''' ({{IPAc-en|ˈ|s|aɪ|θ|ɒ|n}}) is a [[superset]] of the programming language [[Python (programming language)|Python]], which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of [[C (programming language)|C]].<ref>{{cite web |url=https://docs.cython.org/src/quickstart/overview.html |title=Cython - an overview — Cython 0.19.1 documentation |publisher=Docs.cython.org |access-date=21 July 2013}}</ref><ref>{{cite book |last1=Smith |first1=Kurt |title=Cython: A Guide for Python Programmers |date=2015 |publisher=[[O'Reilly Media]] |isbn=978-1-4919-0155-7 |url=https://shop.oreilly.com/product/0636920033431.do}}</ref>
 
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 [[wrapper library|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 (program lifecycle phase)|run time]]. Cython also facilitates wrapping independent C or C++ code into pythonPython-importable modules.
 
Cython is written in Python and C and works on [[Microsoft Windows|Windows]], [[macOS]], and [[Linux]], producing C source files compatible with CPython 2.6, 2.7, and 3.3 and later versions. The Cython source code that Cython compiles (to C) can use both Python 2 and Python 3 syntax, defaulting to Python 2 syntax in Cython 0.x and Python 3 syntax in Cython 3.x. The default can be overridden (e.g. in source code comment) to Python 3 (or 2) syntax. Since Python 3 syntax has changed in recent versions, Cython may not be up to date with the latest additions. Cython has "native support for most of the C++ language" and "compiles almost all existing Python code".<ref>{{Cite web |title=FAQ · cython/cython Wiki |url=https://github.com/cython/cython |access-date=11 January 2023 |website=GitHub |language=en}}</ref>