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
Kirill Smelkov
cython
Commits
3d951d79
Commit
3d951d79
authored
6 years ago
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a code snippet from pure.rst to test it. Removed the colon after the decorator.
parent
5c04c1a8
Changes
2
Show 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 @
3d951d79
import
cython
@
cython
.
exceptval
(
-
1
)
def
func
(
x
:
cython
.
int
)
->
cython
.
int
:
if
x
<
0
:
raise
ValueError
(
"need integer >= 0"
)
return
x
+
1
This diff is collapsed.
Click to expand it.
docs/src/tutorial/pure.rst
View file @
3d951d79
...
...
@@ -167,13 +167,9 @@ Static typing
...
This can be combined with the ``@cython.exceptval()`` decorator for non-Python
return types:
:
return types:
@cython.exceptval(-1):
def func(x : cython.int) -> cython.int:
if x < 0:
raise ValueError("need integer >= 0")
return x+1
.. literalinclude:: ../../examples/tutorial/pure/exceptval.py
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
...
...
This diff is collapsed.
Click to expand it.
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