@@ -177,18 +177,18 @@ def test_array_astype():
177177assert_equal (a ,b )
178178assert_ (not (a is b ))
179179
180- # copy=False parametercan sometimes skip a copy
180+ # copy=False parameterskips a copy
181181b = a .astype ('f4' ,copy = False )
182182assert_ (a is b )
183183
184184# order parameter allows overriding of the memory layout,
185185# forcing a copy if the layout is wrong
186- b = a .astype ('f4' ,order = 'F' ,copy = False )
186+ b = a .astype ('f4' ,order = 'F' ,copy = None )
187187assert_equal (a ,b )
188188assert_ (not (a is b ))
189189assert_ (b .flags .f_contiguous )
190190
191- b = a .astype ('f4' ,order = 'C' ,copy = False )
191+ b = a .astype ('f4' ,order = 'C' ,copy = None )
192192assert_equal (a ,b )
193193assert_ (a is b )
194194assert_ (b .flags .c_contiguous )
@@ -214,12 +214,12 @@ class MyNDArray(np.ndarray):
214214assert_ (a is b )
215215
216216# subok=True is default, and creates a subtype on a cast
217- b = a .astype ('i4' ,copy = False )
217+ b = a .astype ('i4' ,copy = None )
218218assert_equal (a ,b )
219219assert_equal (type (b ),MyNDArray )
220220
221221# subok=False never returns a subclass
222- b = a .astype ('f4' ,subok = False ,copy = False )
222+ b = a .astype ('f4' ,subok = False ,copy = None )
223223assert_equal (a ,b )
224224assert_ (not (a is b ))
225225assert_ (type (b )is not MyNDArray )
@@ -536,9 +536,9 @@ def check_contig(a, ccontig, fcontig):
536536check_contig (np .empty ((2 ,2 ),order = 'F' ),False ,True )
537537
538538# Check that np.array creates correct contiguous flags:
539- check_contig (np .array (a ,copy = False ),False ,False )
540- check_contig (np .array (a ,copy = False ,order = 'C' ),True ,False )
541- check_contig (np .array (a ,ndmin = 4 ,copy = False ,order = 'F' ),False ,True )
539+ check_contig (np .array (a ,copy = None ),False ,False )
540+ check_contig (np .array (a ,copy = None ,order = 'C' ),True ,False )
541+ check_contig (np .array (a ,ndmin = 4 ,copy = None ,order = 'F' ),False ,True )
542542
543543# Check slicing update of flags and :
544544check_contig (a [0 ],True ,True )
@@ -577,18 +577,15 @@ def test_astype_copyflag():
577577res_false = arr .astype (np .intp ,copy = False )
578578# `res_false is arr` currently, but check `may_share_memory`.
579579assert np .may_share_memory (arr ,res_false )
580- res_if_needed = arr .astype (np .intp ,copy = np . _CopyMode . IF_NEEDED )
580+ res_if_needed = arr .astype (np .intp ,copy = None )
581581# `res_if_needed is arr` currently, but check `may_share_memory`.
582582assert np .may_share_memory (arr ,res_if_needed )
583583
584584res_never = arr .astype (np .intp ,copy = np ._CopyMode .NEVER )
585585assert np .may_share_memory (arr ,res_never )
586586
587587# Simple tests for when a copy is necessary:
588- res_false = arr .astype (np .float64 ,copy = False )
589- assert_array_equal (res_false ,arr )
590- res_if_needed = arr .astype (np .float64 ,
591- copy = np ._CopyMode .IF_NEEDED )
588+ res_if_needed = arr .astype (np .float64 ,copy = None )
592589assert_array_equal (res_if_needed ,arr )
593590assert_raises (ValueError ,arr .astype ,np .float64 ,
594- copy = np . _CopyMode . NEVER )
591+ copy = False )