parameters: (physical_line)
docstring: r"""Trailing whitespace is superfluous.
  
      The warning returned varies on whether the line itself is blank, for easier
      filtering for those who want to indent their blank lines.
  
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12
docstring_summary: r"""Trailing whitespace is superfluous.
docstring_tokens: r Trailing whitespace is superfluous .
function: def trailing_whitespace(physical_line):
      r"""Trailing whitespace is superfluous.
  
      The warning returned varies on whether the line itself is blank, for easier
      filtering for those who want to indent their blank lines.
  
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12
      """
      physical_line = physical_line.rstrip('\n')    # chr(10), newline
      physical_line = physical_line.rstrip('\r')    # chr(13), carriage return
      physical_line = physical_line.rstrip('\x0c')  # chr(12), form feed, ^L
      stripped = physical_line.rstrip(' \t\v')
      if physical_line != stripped:
          if stripped:
              return len(stripped), "W291 trailing whitespace"
          else:
              return 0, "W293 blank line contains whitespace"
function_tokens: def trailing_whitespace ( physical_line ) : physical_line = physical_line . rstrip ( '\n' ) # chr(10), newline physical_line = physical_line . rstrip ( '\r' ) # chr(13), carriage return physical_line = physical_line . rstrip ( '\x0c' ) # chr(12), form feed, ^L stripped = physical_line . rstrip ( ' \t\v' ) if physical_line != stripped : if stripped : return len ( stripped ) , "W291 trailing whitespace" else : return 0 , "W293 blank line contains whitespace"