Commit 20de42c5 authored by Yury V. Zaytsev's avatar Yury V. Zaytsev

Fix various typos in the documentation

parent cc511a3d
......@@ -8,12 +8,12 @@ for Python users, so this list may change in the future.
- ``10**-2 == 0``, instead of ``0.01`` like in Python.
- Given two typed ``int`` variables ``a`` and ``b``, ``a % b`` has the
same sign as the second argument (following Python semantics) rather than
having the same sign as the first (as in C). The C behavior can be
obtained, at some speed gain, by enabling the division directive.
(Versions prior to Cython 0.12. always followed C semantics.)
having the same sign as the first (as in C). The C behavior can be
obtained, at some speed gain, by enabling the division directive
(versions prior to Cython 0.12 always followed C semantics).
- Care is needed with unsigned types. ``cdef unsigned n = 10;
print(range(-n, n))`` will print an empty list, since ``-n`` wraps
around to a large positive integer prior to being passed to the
``range`` function.
- Python's ``float`` type actually wraps C ``double`` values, and
Python's ``int`` type wraps C ``long`` values.
Python's ``int`` type wraps C ``long`` values.
......@@ -308,6 +308,6 @@ if someone is interested also under Python 2.x.
There is some speed penalty to this though (as one makes more assumptions
compile-time if the type is set to :obj:`np.ndarray`, specifically it is
assumed that the data is stored in pure strided more and not in indirect
assumed that the data is stored in pure strided mode and not in indirect
mode).
......@@ -18,13 +18,13 @@ Cython Profiling Basics
=======================
Profiling in Cython is controlled by a compiler directive.
It can either be set either for an entire file or on a per function
It can be set either for an entire file or on a per function basis
via a Cython decorator.
Enable profiling for a complete source file
-------------------------------------------
Enabling profiling for a complete source file
---------------------------------------------
Profiling is enable for a complete source file via a global directive to the
Profiling is enabled for a complete source file via a global directive to the
Cython compiler at the top of a file::
# cython: profile=True
......
......@@ -16,20 +16,20 @@ Differences between Cython and Pyrex
and complete as Python as reasonable.
Python 3.0 Support
==================
Python 3 Support
================
Cython creates ``.c`` files that can be built and used with both
Python 2.x and Python 3.x. In fact, compiling your module with
Cython may very well be the easiest way to port code to Python 3.0.
We are also working to make the compiler run in both Python 2.x and 3.0.
Cython creates ``.c`` files that can be built and used with both
Python 2.x and Python 3.x. In fact, compiling your module with
Cython may very well be the easiest way to port code to Python 3.
We are also working to make the compiler run in both Python 2.x and 3.x.
Many Python 3 constructs are already supported by Cython.
Many Python 3 constructs are already supported by Cython.
List/Set/Dict Comprehensions
----------------------------
Cython supports the different comprehensions defined by Python 3.0 for
Cython supports the different comprehensions defined by Python 3 for
lists, sets and dicts::
[expr(x) for x in A] # list
......@@ -68,7 +68,7 @@ takes exactly two positional parameters and has two required keyword parameters.
Conditional expressions "x if b else y" (python 2.5)
Conditional expressions "x if b else y" (Python 2.5)
=====================================================
Conditional expressions as described in
......@@ -76,7 +76,7 @@ http://www.python.org/dev/peps/pep-0308/::
X if C else Y
Only one of ``X`` and ``Y`` is evaluated, (depending on the value of C).
Only one of ``X`` and ``Y`` is evaluated (depending on the value of C).
.. _inline:
......
......@@ -63,7 +63,7 @@ interpreter and simply import it as if it was a regular python module::
>>> import helloworld
Hello World
Congratulations! You now know how to build a Cython extension. But So Far
Congratulations! You now know how to build a Cython extension. But so far
this example doesn't really give a feeling why one would ever want to use Cython, so
lets create a more realistic example.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment