projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc60a99
)
comment on 'not None' signature annotation for memoryview parameters
author
Stefan Behnel
<stefan_ml@behnel.de>
Thu, 21 Jun 2012 14:04:38 +0000
(16:04 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Thu, 21 Jun 2012 14:04:38 +0000
(16:04 +0200)
docs/src/userguide/memoryviews.rst
patch
|
blob
|
history
diff --git
a/docs/src/userguide/memoryviews.rst
b/docs/src/userguide/memoryviews.rst
index
32b7112
..
149d931
100644
(file)
--- a/
docs/src/userguide/memoryviews.rst
+++ b/
docs/src/userguide/memoryviews.rst
@@
-587,6
+587,13
@@
be be checked for being None as well::
def func(double[:] myarray = None):
print myarray is None
+If the function requires real memory views as input, it is therefore best to
+reject None input straight away in the signature, which is supported in Cython
+0.17 and later as follows::
+
+ def func(double[:] myarray not None):
+ ...
+
Unlike object attributes of extension classes, memoryview slices are not
initialized to None.