summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@users.noreply.github.com>2021-07-14 21:21:50 +0200
committerGitHub <noreply@github.com>2021-07-14 21:21:50 +0200
commit13125ee70c72453779fde0c020b53e862e3f613e (patch)
treeded13a68250ec0c12bc9bb0326667d01bf175111
parent54fa2b822565fc9ddef89aa399eb7562d5b76f07 (diff)
downloadcython-13125ee70c72453779fde0c020b53e862e3f613e.tar.gz
docs: Use explicitely the "cython" module in examples (GH-4284)
-rw-r--r--docs/examples/tutorial/external/keyword_args_call.py5
-rw-r--r--docs/examples/tutorial/external/keyword_args_call.pyx1
2 files changed, 2 insertions, 4 deletions
diff --git a/docs/examples/tutorial/external/keyword_args_call.py b/docs/examples/tutorial/external/keyword_args_call.py
index af5b06020..b3b3f5049 100644
--- a/docs/examples/tutorial/external/keyword_args_call.py
+++ b/docs/examples/tutorial/external/keyword_args_call.py
@@ -1,8 +1,7 @@
-import cython
from cython.cimports.strstr import strstr
def main():
- data: p_char = "hfvcakdfagbcffvschvxcdfgccbcfhvgcsnfxjh"
+ data: cython.p_char = "hfvcakdfagbcffvschvxcdfgccbcfhvgcsnfxjh"
- pos: p_char = strstr(needle='akd', haystack=data)
+ pos = strstr(needle='akd', haystack=data)
print(pos is not cython.NULL)
diff --git a/docs/examples/tutorial/external/keyword_args_call.pyx b/docs/examples/tutorial/external/keyword_args_call.pyx
index 3a6b85c8b..de2b6f2b2 100644
--- a/docs/examples/tutorial/external/keyword_args_call.pyx
+++ b/docs/examples/tutorial/external/keyword_args_call.pyx
@@ -1,7 +1,6 @@
cdef extern from "string.h":
char* strstr(const char *haystack, const char *needle)
-
cdef char* data = "hfvcakdfagbcffvschvxcdfgccbcfhvgcsnfxjh"
cdef char* pos = strstr(needle='akd', haystack=data)