parameters: (logical_line)
docstring: r"""Each comma, semicolon or colon should be followed by whitespace.
  
      Okay: [a, b]
      Okay: (3,)
      Okay: a[1:4]
      Okay: a[:4]
      Okay: a[1:]
      Okay: a[1:4:2]
      E231: ['a','b']
      E231: foo(bar,baz)
      E231: [{'a':'b'}]
docstring_summary: r"""Each comma, semicolon or colon should be followed by whitespace.
docstring_tokens: r Each comma semicolon or colon should be followed by whitespace .
function: def missing_whitespace(logical_line):
      r"""Each comma, semicolon or colon should be followed by whitespace.
  
      Okay: [a, b]
      Okay: (3,)
      Okay: a[1:4]
      Okay: a[:4]
      Okay: a[1:]
      Okay: a[1:4:2]
      E231: ['a','b']
      E231: foo(bar,baz)
      E231: [{'a':'b'}]
      """
      line = logical_line
      for index in range(len(line) - 1):
          char = line[index]
          if char in ',;:' and line[index + 1] not in WHITESPACE:
              before = line[:index]
              if char == ':' and before.count('[') > before.count(']') and \
                      before.rfind('{') < before.rfind('['):
                  continue  # Slice syntax, no space required
              if char == ',' and line[index + 1] == ')':
                  continue  # Allow tuple with only one element: (3,)
              yield index, "E231 missing whitespace after '%s'" % char
function_tokens: def missing_whitespace ( logical_line ) : line = logical_line for index in range ( len ( line ) - 1 ) : char = line [ index ] if char in ',;:' and line [ index + 1 ] not in WHITESPACE : before = line [ : index ] if char == ':' and before . count ( '[' ) > before . count ( ']' ) and before . rfind ( '{' ) < before . rfind ( '[' ) : continue # Slice syntax, no space required if char == ',' and line [ index + 1 ] == ')' : continue # Allow tuple with only one element: (3,) yield index , "E231 missing whitespace after '%s'" % char