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
7a9e41e1
Commit
7a9e41e1
authored
Jun 20, 2018
by
scoder
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2374 from gabrieldemarmiesse/test_pure_10
Adding tests for "pure python mode" part 10
parents
68742d85
3d951d79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
docs/examples/tutorial/pure/exceptval.py
docs/examples/tutorial/pure/exceptval.py
+7
-0
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+2
-6
No files found.
docs/examples/tutorial/pure/exceptval.py
0 → 100644
View file @
7a9e41e1
import
cython
@
cython
.
exceptval
(
-
1
)
def
func
(
x
:
cython
.
int
)
->
cython
.
int
:
if
x
<
0
:
raise
ValueError
(
"need integer >= 0"
)
return
x
+
1
docs/src/tutorial/pure.rst
View file @
7a9e41e1
...
@@ -161,13 +161,9 @@ Static typing
...
@@ -161,13 +161,9 @@ Static typing
.. literalinclude:: ../../examples/tutorial/pure/annotations.py
.. literalinclude:: ../../examples/tutorial/pure/annotations.py
This can be combined with the ``@cython.exceptval()`` decorator for non-Python
This can be combined with the ``@cython.exceptval()`` decorator for non-Python
return types:
:
return types:
@cython.exceptval(-1):
.. literalinclude:: ../../examples/tutorial/pure/exceptval.py
def func(x : cython.int) -> cython.int:
if x < 0:
raise ValueError("need integer >= 0")
return x+1
Since version 0.27, Cython also supports the variable annotations defined
Since version 0.27, Cython also supports the variable annotations defined
in `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_. This allows to
in `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_. This allows to
...
...
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