summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/array
diff options
context:
space:
mode:
authorscoder <stefan_ml@behnel.de>2018-06-15 22:44:57 +0200
committerGitHub <noreply@github.com>2018-06-15 22:44:57 +0200
commite8bd642caf613d6e2d272eb943f9631da820d1d6 (patch)
tree9691e65baa522b62da234433042209685570b0be /docs/examples/tutorial/array
parente3e545ec52b2da4cf056b47d736ae4bd5d80b357 (diff)
parent9d7873cdaa8a3f40345d6fa97de11e172a9de43b (diff)
downloadcython-e8bd642caf613d6e2d272eb943f9631da820d1d6.tar.gz
Merge pull request #2347 from gabrieldemarmiesse/test_working_with_python_arrays_4
Adding tests for "working with python arrays" part 4
Diffstat (limited to 'docs/examples/tutorial/array')
-rw-r--r--docs/examples/tutorial/array/clone.pyx8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/examples/tutorial/array/clone.pyx b/docs/examples/tutorial/array/clone.pyx
new file mode 100644
index 000000000..e2bac0e4a
--- /dev/null
+++ b/docs/examples/tutorial/array/clone.pyx
@@ -0,0 +1,8 @@
+from cpython cimport array
+import array
+
+cdef array.array int_array_template = array.array('i', [])
+cdef array.array newarray
+
+# create an array with 3 elements with same type as template
+newarray = array.clone(int_array_template, 3, zero=False)