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
34e357cb
Commit
34e357cb
authored
Jun 04, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document that "@exceptval(check=False)" disables exception propagation completely for a function.
See #3625.
parent
f7ef6eb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+7
-1
No files found.
docs/src/tutorial/pure.rst
View file @
34e357cb
...
...
@@ -153,6 +153,10 @@ Static typing
@exceptval(-1, check=False) # cdef int func() except -1:
@exceptval(check=True) # cdef int func() except *:
@exceptval(-1, check=True) # cdef int func() except? -1:
@exceptval(check=False) # no exception checking/propagation
If exception propagation is disabled, any Python exceptions that are raised
inside of the function will be printed and ignored.
* Python annotations can be used to declare argument types, as shown in the
following example. To avoid conflicts with other kinds of annotation
...
...
@@ -170,7 +174,9 @@ Static typing
for an exception. This means, if no ``@exceptval`` decorator is provided, and the
return type is a numeric type, then the default with type annotations is
``@exceptval(-1, check=True)``, in order to make sure that exceptions are correctly
and efficiently reported to the caller.
and efficiently reported to the caller. Exception propagation can be disabled
explicitly with ``@exceptval(check=False)``, in which case any Python exceptions
raised inside of the function will be printed and ignored.
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
...
...
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