def index_of(val, listOfVals):
  """ 
  Useful method for lists
  (returns -1 instead of ValueError when value not in list)
  """
  try:
    index = listOfVals.index(val)
  except ValueError:
    index = -1

  return index