def extraneous_whitespace(logical_line):
 line = logical_line
 for char in '([{':
  found = line.find((char + ' '))
  if (found > (-1)):
   return ((found + 1), ("E201 whitespace after '%s'" % char))
 for char in '}])':
  found = line.find((' ' + char))
  if ((found > (-1)) and (line[(found - 1)] != ',')):
   return (found, ("E202 whitespace before '%s'" % char))
 for char in ',;:':
  found = line.find((' ' + char))
  if (found > (-1)):
   return (found, ("E203 whitespace before '%s'" % char))

def extraneous_whitespace ( logical_line ) : line = logical_line for char in '([{' : found = line . find ( ( char + ' ' ) ) if ( found > ( - 1 ) ) : return ( ( found + 1 ) , ( "E201 whitespace after '%s'" % char ) ) for char in '}])' : found = line . find ( ( ' ' + char ) ) if ( ( found > ( - 1 ) ) and ( line [ ( found - 1 ) ] != ',' ) ) : return ( found , ( "E202 whitespace before '%s'" % char ) ) for char in ',;:' : found = line . find ( ( ' ' + char ) ) if ( found > ( - 1 ) ) : return ( found , ( "E203 whitespace before '%s'" % char ) )
avoid extraneous whitespace in the following situations: - immediately inside parentheses .