diff options
Diffstat (limited to 'docs/examples/tutorial/array/resize.pyx')
-rw-r--r-- | docs/examples/tutorial/array/resize.pyx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/examples/tutorial/array/resize.pyx b/docs/examples/tutorial/array/resize.pyx index a11fbde7b..7b92958b4 100644 --- a/docs/examples/tutorial/array/resize.pyx +++ b/docs/examples/tutorial/array/resize.pyx @@ -1,10 +1,10 @@ -from cpython cimport array
-import array
-
-cdef array.array a = array.array('i', [1, 2, 3])
-cdef array.array b = array.array('i', [4, 5, 6])
-
-# extend a with b, resize as needed
-array.extend(a, b)
-# resize a, leaving just original three elements
-array.resize(a, len(a) - len(b))
+from cpython cimport array +import array + +cdef array.array a = array.array('i', [1, 2, 3]) +cdef array.array b = array.array('i', [4, 5, 6]) + +# extend a with b, resize as needed +array.extend(a, b) +# resize a, leaving just original three elements +array.resize(a, len(a) - len(b)) |