title: Python equivalent of any(isempty(x)) to test a list
body: <p>I am writing my very first real Python program after years of MATLAB. The program reads in a comma delimited serial string from my Arduino GPS, converts the fields to numbers, plots them on a scatter graph, and then writes them to disk. Each line should look like this (with the precision degraded so no one shows up at my house):</p>
  
  <pre><code>2014, 12, 3, 16, 1, 56, 0, 46.3, -119.2, 118.3, 7
  </code></pre>
  
  <p>where the first 7 fields are the date and time, the next two are the coordinates, the next is the altitude, and the last is the number of satellites in view. If there is no lock, then I instead get something like this:</p>
  
  <pre><code>2014, 12, 3, 16, 1, 56, 0, , , , 0
  </code></pre>
  
  <p>I would like my program to see that there is no lock and skip that measurement. The relevant part of my code looks like this:</p>
  
  <pre><code>import serial
  import string
  
  ser = serial.Serial(
      port='COM27',
      baudrate=9600,
      parity=serial.PARITY_NONE,
      stopbits=serial.STOPBITS_ONE,
      bytesize=serial.EIGHTBITS,
      timeout=5
  )
  
  while True:
      line = ser.readline()
      values = string.split(line, ',')
  
      validList = True
      for x in values:
          if not x:
              validList == False
  
      if not validList:
          continue
  
      for n in range(0, 6):
          values[n] = int(values[n])
  
      values[6] = float(values[6])
      values[7] = float(values[7])
  </code></pre>
  
  <p>However, the program will run for a while and then throw the following error:</p>
  
  <pre><code>values[n] = int(values[n])
  ValueError: invalid literal for int() with base 10: ''
  </code></pre>
  
  <p>Now in MATLAB, the list would be a cell and my test would be:</p>
  
  <pre><code>if any(isempty(values))
      continue;
  end
  </code></pre>
  
  <p>How should I be validating my list?</p>