[SciPy-user] What can be improved ?

fred fredmfp at gmail.com
Wed May 16 08:58:36 EDT 2007


Gael Varoquaux a écrit :
> Hello Stef,
>
>   
> I prefer this construction:
>     for i, val in enumerate(vals):
> 	if val == '':
> 	    vals[i] = '0'
>   
My very 2 cents:

  if val == '':
is equivalent to
  if not val:

(string and list empty equal False)

-- 
http://scipy.org/FredericPetit




More information about the SciPy-User mailing list