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
Boxiang Sun
cython
Commits
4420cb6e
Commit
4420cb6e
authored
Aug 29, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Note on type inference and loop targets.
parent
8b4b796d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
docs/src/quickstart/cythonize.rst
docs/src/quickstart/cythonize.rst
+3
-2
docs/src/reference/compilation.rst
docs/src/reference/compilation.rst
+3
-0
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+3
-0
No files found.
docs/src/quickstart/cythonize.rst
View file @
4420cb6e
...
...
@@ -137,8 +137,9 @@ in general, a ``nogil`` block may contain only "white" code.
.. figure:: htmlreport.png
Note that Cython deduces the type of local variables based on their assignments,
which can also cut down on the need to explicitly specify types everywhere.
Note that Cython deduces the type of local variables based on their assignments
(including as loop variable targets) which can also cut down on the need to
explicitly specify types everywhere.
For example, declaring ``dx`` to be of type double above is unnecessary,
as is declaring the type of ``s`` in the last version (where the return type
of ``f`` is known to be a C double.) A notable exception, however, is
...
...
docs/src/reference/compilation.rst
View file @
4420cb6e
...
...
@@ -397,6 +397,9 @@ Cython code. Here is the list of currently supported directives:
Infer types of untyped variables in function bodies. Default is
None, indicating that only safe (semantically-unchanging) inferences
are allowed.
In particular, inferring *integral* types for variables *used in arithmetic
expressions* is considered unsafe (due to possible overflow) and must be
explicitly requested.
``language_level`` (2/3)
Globally set the Python language level to be used for module
...
...
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
4420cb6e
...
...
@@ -510,6 +510,9 @@ comprehensions). For example, one can write::
f(value)
return [x*x for x in v if x % 2 == 0]
If the loop target variable is unspecified, an assignment from type
``*container.begin()`` is used for :ref:`type inference <compiler-directives>`.
Simplified wrapping with default constructor
--------------------------------------------
...
...
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