is there a better way to check an array?

jdonnell jaydonnell at
Thu Sep 1 18:55:52 CEST 2005

I want to check if a value is in an array. I'm currently doing it as
follows, but I just don't like this way of doing it. It seems

fieldIsRequired = true
    fieldIsRequired = false
except ValueError:

# throw expception if field is required and is empty
if(product[k] == '' and fieldIsRequired):
    raise GMError(k + ' is required')

More information about the Python-list mailing list