Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
0d93a2ba
Commit
0d93a2ba
authored
Mar 16, 2018
by
scoder
Committed by
GitHub
Mar 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2146 from gabrieldemarmiesse/cythonize
Updated cythonize.
parents
6e072444
9ed3e0d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
docs/src/quickstart/cythonize.rst
docs/src/quickstart/cythonize.rst
+12
-6
No files found.
docs/src/quickstart/cythonize.rst
View file @
0d93a2ba
...
...
@@ -3,11 +3,11 @@ Faster code via static typing
Cython is a Python compiler. This means that it can compile normal
Python code without changes (with a few obvious exceptions of some as-yet
unsupported language features
). However, for performance critical
code, it is often helpful to add static type declarations, as they
will allow Cython to step out of the dynamic nature of the Python cod
e
and generate simpler and faster C code - sometimes faster by orders of
magnitude.
unsupported language features
, see :ref:`Cython limitations<cython-limitations>`).
However, for performance critical code, it is often helpful to add
static type declarations, as they will allow Cython to step out of th
e
dynamic nature of the Python code and generate simpler and faster C code
- sometimes faster by orders of
magnitude.
It must be noted, however, that type declarations can make the source
code more verbose and thus less readable. It is therefore discouraged
...
...
@@ -146,4 +146,10 @@ of ``f`` is known to be a C double.) A notable exception, however, is
*integer types used in arithmetic expressions*, as Cython is unable to ensure
that an overflow would not occur (and so falls back to ``object`` in case
Python's bignums are needed). To allow inference of C integer types, set the
``infer_types`` :ref:`directive <compiler-directives>` to ``True``.
``infer_types`` :ref:`directive <compiler-directives>` to ``True``. This directive
does a work similar to the ``auto`` keyword in C++ for the readers who are familliar
with this language feature. It can be of great help to cut down on the need to type
everything, but it also can lead to surprises. Especially if one isn't familiar with
arithmetic expressions with c types. A quick overview of those
can be found `here <https://www.eskimo.com/~scs/cclass/int/sx4cb.html>`_.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment