diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2021-07-18 10:54:04 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2021-07-18 10:54:04 +0200 |
commit | 7528ff8f366130ba1bd99ebbceef58910a89a79f (patch) | |
tree | 8ade31ad1dba0a6f6dcb674ba5c2b7e2795df499 | |
parent | 5bf5aa63d6b6742144071a2af896067c21b3752a (diff) | |
download | cython-7528ff8f366130ba1bd99ebbceef58910a89a79f.tar.gz |
Rephrase "two syntax variants" note to give readers a hint why they exist.
-rw-r--r-- | docs/src/two-syntax-variants-used | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/docs/src/two-syntax-variants-used b/docs/src/two-syntax-variants-used index 4a9815345..af583a0a9 100644 --- a/docs/src/two-syntax-variants-used +++ b/docs/src/two-syntax-variants-used @@ -1,15 +1,18 @@ .. note:: - This page uses two different syntax variants: the Cython specific ``cdef`` syntax - and static Cython type declarations in - :ref:`pure Python code <pep484_type_annotations>`, - following `PEP-484 <https://www.python.org/dev/peps/pep-0484/>`_ type hints - and `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_ variable annotations. - To make good use of the latter, including C data types, etc., you need - the special ``cython`` module, which you can import with + This page uses two different syntax variants: - .. code-block:: python + * Cython specific ``cdef`` syntax, which was designed to make type declarations + concise and easily readable from a C/C++ perspective. - import cython + * Pure Python syntax which allows static Cython type declarations in + :ref:`pure Python code <pep484_type_annotations>`, + following `PEP-484 <https://www.python.org/dev/peps/pep-0484/>`_ type hints + and `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_ variable annotations. - in the Python module that you want to compile. + To make use of C data types in Python syntax, you need to import the special + ``cython`` module in the Python module that you want to compile, e.g. + + .. code-block:: python + + import cython |