diff options
Diffstat (limited to 'docs/examples/tutorial/array/unsafe_usage.pyx')
-rw-r--r-- | docs/examples/tutorial/array/unsafe_usage.pyx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/examples/tutorial/array/unsafe_usage.pyx b/docs/examples/tutorial/array/unsafe_usage.pyx index 2aefeb102..d1f498c68 100644 --- a/docs/examples/tutorial/array/unsafe_usage.pyx +++ b/docs/examples/tutorial/array/unsafe_usage.pyx @@ -1,11 +1,11 @@ -from cpython cimport array
-import array
-
-cdef array.array a = array.array('i', [1, 2, 3])
-
-# access underlying pointer:
-print(a.data.as_ints[0])
-
-from libc.string cimport memset
-
-memset(a.data.as_voidptr, 0, len(a) * sizeof(int))
+from cpython cimport array +import array + +cdef array.array a = array.array('i', [1, 2, 3]) + +# access underlying pointer: +print(a.data.as_ints[0]) + +from libc.string cimport memset + +memset(a.data.as_voidptr, 0, len(a) * sizeof(int)) |