Also, even with a +, maybe the cheese would deform in the center area due to combined displacement from 2 blades
Also, even with a +, maybe the cheese would deform in the center area due to combined displacement from 2 blades
if arr_local is arr_in:
# avoid changing arr_in
arr_local = arr_local.copy()
This avoids doing any copy when not needed.
If you *always* need to modify arr_local, can instead just pass "copy=True" to np.asarray to force a copy.
if arr_local is arr_in:
# avoid changing arr_in
arr_local = arr_local.copy()
This avoids doing any copy when not needed.
If you *always* need to modify arr_local, can instead just pass "copy=True" to np.asarray to force a copy.
arr_local=np.asarray(arr_in, 'float32').
If arr_in is already float32, this just returns the same array.
Now, sometimes it needs to modify elements in arr_local, but we don't want to change the contents of arr_in...
arr_local=np.asarray(arr_in, 'float32').
If arr_in is already float32, this just returns the same array.
Now, sometimes it needs to modify elements in arr_local, but we don't want to change the contents of arr_in...
Likewise for dicts and class instances.
For immutable types like int and str, it would be very unusual to want 'is' vs '=='.
Likewise for dicts and class instances.
For immutable types like int and str, it would be very unusual to want 'is' vs '=='.
'Safer' (?) example would use something like :
a=1000
b=abs(-a)
'Safer' (?) example would use something like :
a=1000
b=abs(-a)
I don't mind.
I don't mind.
She laughed out loud.
She laughed out loud.